jira获取issue条目transitions id,以用来进行流转实用脚本

官方文档链接地址:

The Jira Cloud platform REST API

GET

Get transitions

Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's status.

Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its status, the response will return any empty transitions list.

This operation can be accessed anonymously.

Permissions required: A list or transition is returned only when the user has:

However, if the user does not have the Transition issues project permission the response will not list any transitions.

示例代码如下:

复制代码
//"https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/transitions"
        HttpResponse<JsonNode> response = Unirest.get("https://jira.example.com/rest/api/2/issue/TEST-7/transitions")
                .basicAuth("USER", "TOKEN")
                .header("Accept", "application/json")
                .asJson();

        System.out.println(response.getBody());

返回结果如下:

复制代码
{
  "expand": "transitions",
  "transitions": [
    {
      "name": "未解决",
      "id": "91",
      "to": {
        "name": "重新打开",
        "self": "https://jira.example.com/rest/api/2/status/10359",
        "description": "问题未彻底修复",
        "iconUrl": "https://jira.example.com/images/icons/statuses/generic.png",
        "id": "10359",
        "statusCategory": {
          "colorName": "yellow",
          "name": "In Progress",
          "self": "https://jira.example.com/rest/api/2/statuscategory/4",
          "id": 4,
          "key": "indeterminate"
        }
      }
    },
    {
      "name": "验证通过",
      "id": "81",
      "to": {
        "name": "关闭",
        "self": "https://jira.example.com/rest/api/2/status/10127",
        "description": "",
        "iconUrl": "https://jira.example.com/images/icons/statuses/generic.png",
        "id": "10127",
        "statusCategory": {
          "colorName": "green",
          "name": "Done",
          "self": "https://jira.example.com/rest/api/2/statuscategory/3",
          "id": 3,
          "key": "done"
        }
      }
    }
  ]
}

在此做个笔记

相关推荐
summer_west_fish5 天前
Troubleshooting Issue for Integrating Host to K8S
issue
云淡风轻~~10 天前
怎么提Issue与PR
github·issue·pr
一叶轻舟随风行13 天前
Kanass,一款超级轻量且简洁的项目管理工具
jira·项目管理工具·kanass
黄金旺铺1 个月前
【GitHub Issue Fetcher】 轻松整理项目问题与解决方案知识库
github·issue
Tony Bai2 个月前
【AI应用开发第一课】11 实战串讲:用 Go 构建一个 AI 驱动的 GitHub Issue 助手
人工智能·issue
张3蜂2 个月前
Jira vs. GitLab Issues vs. Redmine:终极选型与成本分析
gitlab·jira·redmine
jiasting2 个月前
高通平台wifi--p2p issue
asp.net·p2p·issue
2 个月前
从Redmine及Jira到Codes:为什么我换了项目管理软件?
开源·jira·项目管理软件·零代码开发·redmine·免费项目管理软件·开源项目管理软件
F_D_Z3 个月前
conda issue
python·github·conda·issue
Waltt_Qiope4 个月前
关于使用cursor tunnel链接vscode(避免1006 issue的做法)
ide·vscode·issue