gpt4 book ai didi

curl - 使用 REST API 更新 JIRA 票证状态

转载 作者:行者123 更新时间:2023-12-04 23:44:55 32 4
gpt4 key购买 nike

我能够使用 CURL 命令在 JIRA 中创建一个票证,并有一个方便的 json 数据。

curl -D- -u : -X POST --data @< filename> -H "Content-Type: application/json" http://< hostname>:< port>/rest/api/2/issue/



我现在试图更新生成的票的状态,但收到以下错误。 {"errorMessages":[],"errors":{"status":"Field 'status' cannot be set. It is not on the appropriate screen, or unknown."}}
curl 命令:

curl -D- -u < user>:< pwd> -X PUT --data @data_update.txt -H "Content-Type: application/json" http://< hostname>:8100/rest/api/2/issue/MTF-3

最佳答案

状态不是 Jira 中的字段,因此无法动态更改相同的字段。 JIRA API 没有这方面的规定。

我们必须跟随转变并相应地改变。

首先,执行‘ http://localhost:8100/rest/api/latest/issue/MTF -2/transitions?expand=transitions.fields
并知道用于转换的 ID。

例如:“停止进度”的转换 ID 为 31,“完成”的转换 ID 为 41。

一旦知道,通过添加与您的环境相关的值来使用以下链接:

curl -D- -u <USER>:<PASS> -X POST --data '{"transition":{"id":"<TRANSITION_ID>"}}' -H "Content-Type: application/json" <JIRA_URL>:<JIRA_PORT>/rest/api/latest/issue/<JIRA_ISSUE>/transitions?expand=transitions.fields

引用:检查保罗授予答案 -
https://answers.atlassian.com/questions/107630/jira-how-to-change-issue-status-via-rest

关于curl - 使用 REST API 更新 JIRA 票证状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30809831/

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