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

在此做个笔记

相关推荐
一叶轻舟随风行9 小时前
kanass实战教程系列(10) - 如何进行缺陷管理
jira·禅道·项目管理工具·开源项目管理工具
一叶轻舟随风行10 小时前
kanass实战教程系列(11) - 如何进行迭代管理
jira·禅道·项目管理工具
一叶轻舟随风行4 天前
kanass实战教程系列(4) - 产品经理如何使用kanass有效管理需求
jira·禅道·项目管理工具
一叶轻舟随风行4 天前
kanass实战教程系列(5) - 开发团队如何通过kanass有效管控开发任务
jira·禅道·项目管理工具
一叶轻舟随风行4 天前
kanass实战教程系列(6) - 测试团队如何通过kanass管理跟踪用例与缺陷
jira·禅道·项目管理工具
一叶轻舟随风行5 天前
Kanass实战教程系列(1) - 安装与配置
jira·项目管理工具
一叶轻舟随风行7 天前
一文掌握,kanass安装与配置
jira·禅道·项目管理工具·ones
一叶轻舟随风行8 天前
拒绝繁琐,介绍一款简洁易用的项目管理工具-Kanass
jira·禅道·项目管理工具
CV视觉8 天前
AI 实战篇:用 LangGraph 串联 RAG+MCP Server,打造能直接操控 Jira 的智能体
人工智能·深度学习·机器学习·自然语言处理·langchain·prompt·jira
扫地僧过江南10 天前
kanass零基础学习,项目负责人如何使用kanass驾驭项目
jira·禅道·项目管理工具