gpt4 book ai didi

json - 如何使用 JIRA Cloud REST API 创建关于 jira 问题的内部评论

转载 作者:行者123 更新时间:2023-12-02 00:44:00 26 4
gpt4 key购买 nike

关于如何对内部问题发表评论真的很难找到明确的答案。

最佳答案

JIRA Cloud REST API 文档指定了以下架构,用于在创建或更新事件评论时设置评论属性

https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/comment-addComment

"properties": {
"type": "array",
"items": {
"title": "Entity Property",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {}
},
"additionalProperties": false
}
}

要对内部问题发表评论(意味着只有服务台代理可以看到评论),您需要将 sd.public.comment 键设置为具有值 { "internal ": 真 这可以通过在创建或更新 API 请求的主体中传递以下 JSON 来实现。

{
"properties": {
"key": "sd.public.comment",
"value": {
"internal": true
}
}
}

您还需要在请求中设置 Content-Type header 。

Content-Type: application/json

以下是使用 Groovy 脚本创建内部评论的示例 - ScriptRunner(一种流行的 JIRA 插件)使用的脚本语言

post("/rest/api/2/issue/${issue.id}/comment")
.header("Content-Type", "application/json")
.body([
body: "This is the text which will appear in the comment",
properties: [
[key: "sd.public.comment", value: [ "internal": true ]]
]
]).asString()

请注意,对象/JSON 映射将根据您使用的脚本语言或 HTTP 请求框架而有所不同。

关于json - 如何使用 JIRA Cloud REST API 创建关于 jira 问题的内部评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45031475/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com