使用 Azure DevOps Services REST API 添加描述的超链接 [英] Add hyperlink to description with Azure DevOps Services REST API

查看:20
本文介绍了使用 Azure DevOps Services REST API 添加描述的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

<预><代码>[{"op": "添加","path": "/fields/System.Title",来自":空,"value": "示例任务"},{"op": "添加","path": "/fields/System.Description",来自":空,"value": "链接:https://stackoverflow.com/"}]

我要实现这个效果,特别是在描述中有超链接:

说明:

链接:https://stackoverflow.com/

我无法在帖子上放照片,所以我放了链接:https://i.imgur.com/E4Q2xmB.png

可以添加这个吗?

解决方案

调整你的身体:

<预><代码>[{"op": "添加","path": "/fields/System.Title",来自":空,"value": "示例任务"},{"op": "添加","path": "/fields/System.Description",来自":空,"value": "<div>链接:<a href="https://stackoverflow.com/">https://stackoverflow.com/</a></div>"}]

My actual code which paste this as plain text, not as hyperlink: POST to: 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/ "
  }
]

I want to achieve this effect, especially to have hyperlink in the description:

Description:

Link: https://stackoverflow.com/

I can't put photo to the post so i put link to it: https://i.imgur.com/E4Q2xmB.png

Is it possible to add this?

解决方案

Adjust your body to this:

[
  {
    "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>"
  }
]

这篇关于使用 Azure DevOps Services REST API 添加描述的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆