通过API列出所有JIRA转换 [英] Listing All JIRA Transitions via API
问题描述
我希望在JIRA中设置智能提交,但是我的开发人员希望了解其过渡的所有选项.为了帮助他们,我想打印所有过渡名称的备忘单(我相信他们足够聪明,可以从那里找出要做什么).
I'm looking to set up smart commits in JIRA, but my developers want to know all the options for their transitions. In order to help them, I'd like to print a cheat-sheet of all transition names (I trust they are smart enough to figure out what does what from there).
但是,当我浏览REST API文档时,我只能找到一种方法来获取
But when I look through the REST API documentation, I can only find a way to get the list of transitions for a particular issue (presumably via its status). Is there a way to get the list of all transitions that any ticket can take at any point in its workflow?
推荐答案
You can get all transitions for project with /rest/api/2/project/{projectIdOrKey}/statuses endpoint. Here is response example, look at "statuses" array:
[
{
"self": "http://localhost:8090/jira/rest/api/2.0/issueType/3",
"id": "3",
"name": "Task",
"subtask": false,
"statuses": [
{
"self": "http://localhost:8090/jira/rest/api/2.0/status/10000",
"description": "The issue is currently being worked on.",
"iconUrl": "http://localhost:8090/jira/images/icons/progress.gif",
"name": "In Progress",
"id": "10000"
},
{
"self": "http://localhost:8090/jira/rest/api/2.0/status/5",
"description": "The issue is closed.",
"iconUrl": "http://localhost:8090/jira/images/icons/closed.gif",
"name": "Closed",
"id": "5"
}
]
}
]
但是它并没有为您提供任何问题随时可能发生的转换的确切列表,而且我不确定API中是否存在这种方法.
But it doesn't give you exactly list of transitions that any issue can take at any time, and I'm not sure that such method exist in API.
这篇关于通过API列出所有JIRA转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!