我希望能够通过Jira API为问题添加标记。我无法找到有关此问题的任何文档。有谁知道这是如何工作的?
我已经想出如何做到这一点,我不确定API的版本。我做了一个POST
请求:
你的域名/rest/greenhopper/1.0/xboard/issue/flag/flag.json
并在正文中(用您的问题密钥替换JIRA-ISSUE):
{"issueKeys":["JIRA-ISSUE"],"flag":true}
我希望这有帮助。
这是我找到的最佳答案。 https://answers.atlassian.com/questions/38062844/answers/38062897
有一个名为Flagged的字段。它是一个复选框类型字段。默认情况下,有一个值Impediment。检查该字段是否为空状态。如果该字段为空,则不会标记该问题。如果该字段不为null,则标记该问题。
您可以使用REST API。示例在这里 -
https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue.
您需要知道字段ID(customfield_10000),或者您需要通过搜索元数据来编写字段的发现 - https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues。
在通过API创建问题时设置自定义字段的示例 -
curl -D- -u fred:fred -X POST --data {"fields":{"project":{"key": "TEST"}, "summary": "Always do right. This will gratify some people and astonish the REST.", "description": "Creating an issue while setting custom field values", "issuetype":{"name": "Bug"}, "customfield_10000": [{"value": "Impediment"}]}} -H "Content-Type: application/json" http://localhost:8090/rest/api/2/issue/
non-minified data Expand source
{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "Always do right. This will gratify some people and astonish the REST.",
"description": "Creating an issue while setting custom field values",
"issuetype": {
"name": "Bug"
},
"customfield_10000": [ {"value": "Impediment" }]
}
}