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

在此做个笔记

相关推荐
piikee7 天前
DeepSeek Harness 开源贡献手记:从 Issue 到 Merge 的完整旅程
issue
71777711 天前
有没有国产 Jira?2026 年主流国产替代方案对比与 Gitee 定位解析
gitee·jira
Skrrapper13 天前
AI项目实战日记ep2:把 GitHub Issue 的第一轮脏活交给 AI:做一个 Issue 分诊助手
人工智能·github·issue
小雨爱测20 天前
DeepSeek Harness 开源贡献手记:从提 Issue 到合入主干的完整旅程
开源·issue
troy12820 天前
Jira 详细介绍与操作全指南:从入门到精通
jira
Eloudy22 天前
全文 - 第 01 章 CHI Issue.B specification
arm开发·issue
troy12822 天前
从 JIRA 到监控:一条完整的 DevOps 交付流水线实战
运维·devops·jira
进击的雷神1 个月前
Jira 让你适应工具,Kaneo 让工具适应你
开源·jira·kaneo
2601_968354541 个月前
DeepSeek Harness 开源贡献手记:从 Issue 到 Merge 的完整旅程
开源·issue
●VON2 个月前
AtomGit 新手教程:Issue 和 PR 是什么?从 Fork、Clone 到提交 Pull Request 全流程
计算机·issue·pr