使用Azure DevOps Services REST API向描述添加超链接

时间:2019-01-16 16:46:39

标签: azure-devops azure-devops-rest-api

我的实际代码将其粘贴为纯文本而不是超链接: POST到:https://dev.azure.com/ {user} / {project} / _ apis / wit / workitems / $ {type}?api-version = 5.0-preview.3

[
  {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "Sample task"
  },
  {
    "op": "add",
    "path": "/fields/System.Description",
    "from": null,
    "value": "Link: https://stackoverflow.com/ "
  }
]

我想实现这种效果,特别是在说明中具有超链接:

说明:

链接:https://stackoverflow.com/

我无法将照片张贴在帖子上,因此我将其链接: https://i.imgur.com/E4Q2xmB.png

可以添加吗?

1 个答案:

答案 0 :(得分:1)

为此调整您的身体:

[
  {
    "op": "add",
    "path": "/fields/System.Title",
    "from": null,
    "value": "Sample task"
  },
  {
    "op": "add",
    "path": "/fields/System.Description",
    "from": null,
    "value": "<div>Link: <a href=\"https://stackoverflow.com/\">https://stackoverflow.com/</a></div>"
  }
]