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

在此做个笔记

相关推荐
微学AI10 小时前
把 GitHub Issue 的“第一轮脏活”交给 AI:Issue AI Agent 接入蓝耘元生代实战
人工智能·github·issue
技术传感器3 天前
让 Hermes 自动完成一个软件需求:从 Issue 到 PR 的 AI 开发流水线
人工智能·架构·aigc·需求分析·issue
ERD Online8 天前
我们怎么设计 good first issue:让第一个 PR 两小时内合入
数据库·git·后端·开源·issue
johnny23314 天前
CLI项目:Jira-cli、xiaohongshu-cli、boss-cli
jira
猴哥聊项目管理14 天前
禅道/Jira/Linear等横评:2026项目管理软件10款实测
项目管理·jira·团队管理·团队协作·项目管理软件·研发管理
71777719 天前
研发效能治理标准化路径:基于信通院认证平台的全链路度量实践
安全·gitee·issue
龙智DevSecOps解决方案19 天前
ITSM选型指南 | Jira Service Management Standard vs Cloud Premium 版本对比与升级指导
atlassian·devops·aiops·jira·itsm·智能运维
71777721 天前
Coze 工作流 + Gitee API 落地指南:研发 Issue 智能化自动管理实践
gitee·jquery·issue
狂热开发者25 天前
“不是 Jira,是 Linear”:我用一段技术口述测试 Typeoff 的自动纠正
jira
龙智DevSecOps解决方案1 个月前
Atlassian团队协作套件技术评估:Jira、Confluence、Loom 与 Rovo Agent 的协同架构分析
ai·atlassian·jira·企业协作