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

在此做个笔记

相关推荐
一叶轻舟随风行3 天前
kanass全面介绍(1) - 安装、配置
jira·禅道·开源项目管理工具
一叶轻舟随风行6 天前
多款项目管理工具纵评:Jira 、bugzilla、mantis 、Kanass
jira·禅道·开源项目管理工具
龙智DevSecOps解决方案7 天前
周四下午2:30!解锁 AI 驱动的 DevOps 转型——Atlassian Cloud + AI 实战指南
ai·atlassian·devops·jira·confluence
一叶轻舟随风行8 天前
kanass实战教程系列(25) - 如何将评审与钉钉通知相结合
jira·禅道·开源项目管理工具
一叶轻舟随风行10 天前
Kanass V1.3.9 版本发布,新增Arm64架构的centos/ubuntu/debian等系统安装与事项的快速拆分功能
jira·禅道·开源项目管理工具
沟通QQ:48773927810 天前
参数区分:基于案例的决策树算法与MATLAB应用
jira
扫地僧过江南15 天前
Kanass实战解读(16) - 如何通过评审,有效保障需求和用例的质量
jira·禅道·开源项目管理工具
Wpa.wk18 天前
软件测试的流程-介绍
经验分享·测试工具·jira·测试流程·测试流程管理
一叶轻舟随风行24 天前
kanass实战教程系列(10) - 如何进行缺陷管理
jira·禅道·项目管理工具·开源项目管理工具
一叶轻舟随风行24 天前
kanass实战教程系列(11) - 如何进行迭代管理
jira·禅道·项目管理工具