有没有办法让我能找到一个问题的史诗?
api返回了很多有关问题的信息,但不包括史诗.
我正在使用JIRA REST API(https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs).
fia*_*iat 12
我想提取一个史诗名称issue,这让我难过了几天.关键是要认识到的epic是只母的问题,而史诗的名字是summary父母的领域issue.
所以:
步骤1
使用查询查找存储史诗的自定义字段editmeta:
HTTPS:// [您的JIRA主机名]/JIRA/REST/API/2 /问题/ [发行数]/editmeta
这将产生类似下面的内容,它显示我们需要的自定义字段ID
{
"fields": {
<SNIP>
"customfield_12360": {
"required": false,
"schema": {
"type": "any",
"custom": "com.pyxis.greenhopper.jira:gh-epic-link",
"customId": 12360
},
"name": "Epic Link",
"operations": [
"set"
]
}
<SNIP>
}
}
Run Code Online (Sandbox Code Playgroud)
第2步
查询您的问题,提取自定义字段值
HTTPS:// [您的JIRA主机名]/JIRA/REST/API/2 /问题/ [发行数]字段= customfield_12360,汇总
如果JIRA-34说我们的问题,这会产生类似的结果
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "39080",
"key": "JIRA-34",
"fields": {
"summary": "Write heavily upvoted answers for stack overflow",
"customfield_12360": "JIRA-33"
}
}
Run Code Online (Sandbox Code Playgroud)
第3步
现在我们知道史诗的问题号JIRA-33,现在查询史诗......
HTTPS:// [您的JIRA主机名]/JIRA/REST/API/2 /问题/ JIRA-33场=总结?
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "39080",
"key": "JIRA-33",
"fields": {
"summary": "Improve StackOverflow reptuation"
}
}
Run Code Online (Sandbox Code Playgroud)
史诗的名称JIRA-34是"改善StackOverflow reptuation"
完成.