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

在此做个笔记

相关推荐
龙智DevSecOps解决方案3 天前
工作管理实战指南:利用Jira、Confluence等Atlassian工具打破信息孤岛,增强团队协作【含免费指南】
atlassian·jira·工作管理
龙智DevSecOps解决方案16 天前
一站式协作平台Jira新功能解读:AI驱动、个性化设置、灵活自定义等,助力项目管理更高效
人工智能·atlassian·jira
钉钉项目Teambition1 个月前
Jira Cloud涨价5%-20%,钉钉项目Teambition成优选替代
钉钉·jira·teambition
Yan-英杰2 个月前
Encountered error while trying to install package.> lxml
开发语言·python·pandas·pip·issue
这家伙是个好家伙2 个月前
GitHub Copilot Issue in Visual Studio Code “Status Ready (disabled)“
vscode·github·copilot·issue
fareast_mzh2 个月前
Linux scp hidden file issue
linux·运维·issue
wish3663 个月前
.NET App accesses MSSQL to report TLS issue on Linux and Docker
linux·经验分享·docker·sqlserver·.net·devops·issue
Wninacc3 个月前
jira敏捷开发管理工具视频教程Confluence工作流协同开发(2024)
java·javascript·eclipse·敏捷流程·jira
龙智DevSecOps解决方案3 个月前
龙智Atlassian解决方案实践案例:集成Jira、Confluence、JSM,助力某汽车行业客户实现高效项目管理
车载系统·atlassian·jira