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

在此做个笔记

相关推荐
HELLO程序员18 小时前
Repo-First 新范式:SpecKit + MCP 一键同步 Jira、Confluence、Figma
figma·jira
风雨 兼程1 天前
HCCL贡献指南 从Issue到PR合并全流程解析
issue·cann
MYPM_AndyLiu7 天前
对比 Codes、Jira、禅道、PingCode 等工具的需求管理方式
项目管理·产品经理·jira·项目经理·codes·需求管理对比
Warren988 天前
Pytest Fixture 作用域详解:Function、Class、Module、Session 怎么选
面试·职场和发展·单元测试·pytest·pip·模块测试·jira
WangShade8 天前
Jira部署在Windows完整流程
windows·jira·confluence
龙智DevSecOps解决方案13 天前
现代服务管理指南:Jira Service Management + Rovo的AI自动化架构与实战应用
人工智能·自动化·atlassian·jira·itsm·服务管理
cvcNYgAdnd13 天前
单相光伏并网Matlab仿真模型:双闭环并网策略的奇妙之旅
jira
亮子AI19 天前
【Github】如何取消 issue 自动加入 project 的功能?
github·issue
ASKED_201919 天前
macOS 使用 Codex CLI 登录报错 403 的问题分析与解决方案(Issue #2414)
macos·issue
唐古乌梁海21 天前
【Test】jira安装和配置
jira