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

在此做个笔记

相关推荐
vvw&9 天前
如何部署和配置项目管理工具 Plane - 开源 Jira 替代方案
linux·运维·服务器·ubuntu·开源·jira·plane
Xlous_Mao15 天前
# issue 8 TCP内部原理和UDP编程
linux·服务器·网络·学习·tcp/ip·udp·issue
Xlous_Mao16 天前
# issue 9 进程
linux·服务器·学习·issue
bread_00117 天前
jira导出文件乱码怎么解决
测试工具·jira
Xlous_Mao20 天前
# issue 7 TCP回声服务器和客户端
服务器·网络·c++·网络协议·学习·tcp/ip·issue
Xlous_Mao23 天前
# issue 6 网络编程基础
服务器·网络·学习·issue
为啥我就不胖呢25 天前
Jira使用笔记二 ScriptRunner 验证问题创建角色
笔记·jira
龙智DevSecOps解决方案2 个月前
工作管理实战指南:利用Jira、Confluence等Atlassian工具打破信息孤岛,增强团队协作【含免费指南】
atlassian·jira·工作管理
龙智DevSecOps解决方案2 个月前
一站式协作平台Jira新功能解读:AI驱动、个性化设置、灵活自定义等,助力项目管理更高效
人工智能·atlassian·jira