gpt4 book ai didi

JIRA API : Get epic for issue

转载 作者:行者123 更新时间:2023-12-04 00:54:21 26 4
gpt4 key购买 nike

有没有办法让我获得史诗般的问题?

api 返回有关问题的大量信息,但不包括史诗。

我正在使用 JIRA REST API ( https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs )。

最佳答案

我想为 issue 提取史诗名称这让我难住了几天。
关键是要意识到 epic只是一个父问题,而 史诗名称summary父字段 issue .

所以:

步骤 1

使用 editmeta 查找存储史诗的自定义字段询问:

https://[your-jira-hostname]/jira/rest/api/2/issue/[issue-number]/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>
}
}

步骤 2

查询您的问题,提取自定义字段值

https://[your-jira-hostname]/jira/rest/api/2/issue/[issue-number]?fields=customfield_12360,summary

如果我们的问题是 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"
}
}

步骤 3

现在我们知道我们史诗的发行号是 JIRA-33 ,所以现在查询史诗...

https://[your-jira-hostname]/jira/rest/api/2/issue/JIRA-33?fields=summary
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "39080",
"key": "JIRA-33",
"fields": {
"summary": "Improve StackOverflow reptuation"
}
}

史诗的名字为 JIRA-34是“提高 StackOverflow 信誉”

完毕。

关于JIRA API : Get epic for issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24385644/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com