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

在此做个笔记

相关推荐
钉钉项目Teambition10 天前
Jira Cloud涨价5%-20%,钉钉项目Teambition成优选替代
钉钉·jira·teambition
Yan-英杰15 天前
Encountered error while trying to install package.> lxml
开发语言·python·pandas·pip·issue
这家伙是个好家伙23 天前
GitHub Copilot Issue in Visual Studio Code “Status Ready (disabled)“
vscode·github·copilot·issue
fareast_mzh1 个月前
Linux scp hidden file issue
linux·运维·issue
wish3662 个月前
.NET App accesses MSSQL to report TLS issue on Linux and Docker
linux·经验分享·docker·sqlserver·.net·devops·issue
Wninacc2 个月前
jira敏捷开发管理工具视频教程Confluence工作流协同开发(2024)
java·javascript·eclipse·敏捷流程·jira
龙智DevSecOps解决方案2 个月前
龙智Atlassian解决方案实践案例:集成Jira、Confluence、JSM,助力某汽车行业客户实现高效项目管理
车载系统·atlassian·jira
ryfdizuo2 个月前
STL Map的使用和性能issue
java·c++·issue
Yan-英杰2 个月前
【BUG】已解决:ModuleNotFoundError: No module named ‘paddle‘
python·bug·excel·pip·paddle·issue
Yan-英杰2 个月前
【BUG】已解决:xlrd.biffh.XLRDError: Excel xlsx file; not supported
开发语言·python·bug·excel·pip·issue