使用 jira rest api - 我如何获得特定问题的描述?
Using jira rest api - how can I get description of a specific issue?
我正在尝试使用此处提供的 jira rest api https://developer.atlassian.com/server/jira/platform/rest-apis/,并且我正在尝试弄清楚如何在我的项目中获取特定问题的描述。
当我执行以下查询时:
curl -D- -u user:password -X GET -H "Content-Type: application/json"
"http://localhost/jira/rest/api/2/issue/ISSUE_NUMBER_1"
我确实得到了整个问题的回复。它包含很多字段,例如"avatarUrls"
、displayName
,但它还包含body
。我有兴趣只得到后者。如何限制我的查询,使其仅 returns body
?我试过:
curl -D- -u user:password -X GET -H "Content-Type: application/json"
"http://localhost/jira/rest/api/2/issue/ISSUE_NUMBER_1?fields=body"
但它不起作用。这里有什么问题?
您可以使用它来仅检索问题的描述:
/rest/api/2/issue/KEY-123?fields=description
这个returns
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "10218",
"self": "http://localhost:8080/rest/api/2/issue/10218",
"key": "KEY-123",
"fields": {
"description": "The issue description"
}
}
我正在尝试使用此处提供的 jira rest api https://developer.atlassian.com/server/jira/platform/rest-apis/,并且我正在尝试弄清楚如何在我的项目中获取特定问题的描述。
当我执行以下查询时:
curl -D- -u user:password -X GET -H "Content-Type: application/json" "http://localhost/jira/rest/api/2/issue/ISSUE_NUMBER_1"
我确实得到了整个问题的回复。它包含很多字段,例如"avatarUrls"
、displayName
,但它还包含body
。我有兴趣只得到后者。如何限制我的查询,使其仅 returns body
?我试过:
curl -D- -u user:password -X GET -H "Content-Type: application/json" "http://localhost/jira/rest/api/2/issue/ISSUE_NUMBER_1?fields=body"
但它不起作用。这里有什么问题?
您可以使用它来仅检索问题的描述:
/rest/api/2/issue/KEY-123?fields=description
这个returns
{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "10218",
"self": "http://localhost:8080/rest/api/2/issue/10218",
"key": "KEY-123",
"fields": {
"description": "The issue description"
}
}