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

在此做个笔记

相关推荐
xyzhan17 小时前
人工智能代理AI Agent如何自动化CRM、Jira、计费和Slack之间的工作流程
运维·人工智能·自动化·jira·ai agent
一袋米扛几楼985 天前
【JIRA】Scrum 到底是什么?
scrum·jira
warm3snow8 天前
AI 重塑产品管理工具:从 Jira 到智能体项目经理的终极演进
人工智能·ai·excel·项目管理·飞书·产品经理·jira·协同·tapd
HELLO程序员1 个月前
Repo-First 新范式:SpecKit + MCP 一键同步 Jira、Confluence、Figma
figma·jira
风雨 兼程1 个月前
HCCL贡献指南 从Issue到PR合并全流程解析
issue·cann
MYPM_AndyLiu1 个月前
对比 Codes、Jira、禅道、PingCode 等工具的需求管理方式
项目管理·产品经理·jira·项目经理·codes·需求管理对比
Warren982 个月前
Pytest Fixture 作用域详解:Function、Class、Module、Session 怎么选
面试·职场和发展·单元测试·pytest·pip·模块测试·jira
WangShade2 个月前
Jira部署在Windows完整流程
windows·jira·confluence
龙智DevSecOps解决方案2 个月前
现代服务管理指南:Jira Service Management + Rovo的AI自动化架构与实战应用
人工智能·自动化·atlassian·jira·itsm·服务管理
cvcNYgAdnd2 个月前
单相光伏并网Matlab仿真模型:双闭环并网策略的奇妙之旅
jira