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 自动加入 project 的功能?
github·issue
ASKED_201910 小时前
macOS 使用 Codex CLI 登录报错 403 的问题分析与解决方案(Issue #2414)
macos·issue
唐古乌梁海2 天前
【Test】jira安装和配置
jira
vftOWpVs4 天前
激光焊接机控制方案全解析
jira
oscar99913 天前
打通测试与管理的桥梁:Katalon Studio与Jira的集成
集成·jira·katalon
MindCareers14 天前
Beta Sprint Day 1-2: Alpha Issue Fixes Initiated + Mobile Project Setup
android·c语言·数据库·c++·qt·sprint·issue
不过如此195115 天前
Jira系统中JQL语句的介绍
python·sql·jira
企鹅郁金香15 天前
Jira部署安装教程
jira·nginx反向代理jira·jira 的仪表盘配置存在问题·jira安装部署教程·jira配置nginx页面报错
不过如此195115 天前
Python操作Jira实现不同项目之间的Issue同步
python·jira·issue
安得权21 天前
使用GitHub CLI(gh)来创建 GitHub Issue
github·issue