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

在此做个笔记

相关推荐
MaisieKim_20 天前
Jira、PingCode、Redmine等18款缺陷管理工具对比评测
jira·redmine·pingcode
hyhrosewind1 个月前
基础(项目管理工具:JIRA、禅道)
jira·缺陷管理·禅道·项目管理工具·jira安装·禅道安装
测试渣2 个月前
JIRA/Xray测试管理工具的最佳实践:从基础到高阶的全场景指南
测试工具·自动化·jira
公众号:ITIL之家2 个月前
ServiceNow vs Jira:哪个更适合中国式ITIL落地?
jira
龙智DevSecOps解决方案2 个月前
汽车行业敏捷开发实践:基于Atlassian工具链的全流程解决方案(Jira、Confluence、Jira Service Management等)
atlassian·敏捷流程·jira·汽车软件开发
hillstream32 个月前
jira操作笔记
笔记·jira
龙智DevSecOps解决方案2 个月前
需求管理工具选型指南:Jama Connect +Jira vs Word/Excel+Jira
项目管理·atlassian·需求管理·jira·jamaconnect
跟YY哥学Jira2 个月前
解密 Atlassian Cloud:创新驱动的项目管理之道
经验分享·项目管理·微信公众平台·jira·jira认证
唐古乌梁海3 个月前
【jira】用到几张表
jira
龙智DevSecOps解决方案3 个月前
项目管理工具Jira在营销工作管理中的应用与实践
项目管理·atlassian·jira·confluence