I need to use the JIRA REST API to return issues with 15824 as the value of id in the fixVersions field. As you might know, that field is an array and can contain more than one version. My results are expected to have at least one element, sometimes two. Here is a sample with one version:
"fixVersions": [
{
"self": "https:\/\/aDomain\/rest\/api\/2\/version\/15824",
"id": "15824",
"name": "2014-08",
"archived": false,
"released": false
} ]
Here is a sample with two versions:
"fixVersions": [
{
"self": "https:\/\/domain\/rest\/api\/2\/version\/16011",
"id": "16011",
"description": "ae426557c89782c8446b03b0eacaef649373b10a",
"name": "2.2.0",
"archived": false,
"released": true,
"releaseDate": "2014-08-31"
},
{
"self": "https:\/\/domain\/rest\/api\/2\/version\/15824",
"id": "15824",
"name": "2014-08",
"archived": false,
"released": false
}
]
Regardless of the number of fix versions, the issues I want will always have 15824 as the id.
I tried this query:
/rest/api/2/search?jql=project=MYPROJECT&fixVersion=15824&fields=id,key,fixVersions
But that returns issues with other fixVersions, and sometimes issues with no fix versions assigned.
Can you help me?
Authentication for REST API requests Jira Service Management uses cookie-based authentication in the browser. Therefore, you can call the REST API from JavaScript on a page and rely on the authentication that the browser has established.
Jira REST APIs provide access to resources (that is, data entities) via URI paths. To use a REST API, your application makes an HTTP request and parse the response. Currently there are two API names available, which will be discussed later on this page: auth: – for authentication-related operations.
When you specify ths JQL part of your request, don't use &
sign but use the JQL syntax (AND
) to specify multiple conditions.
&
sign only splits the query string parameters of the request. These are the possible query string parts:
jql
startAt
maxResults
validateQuery
fields
expand
So your proper request should be
/rest/api/2/search?jql=project=MYPROJECT and fixVersion=15824&fields=id,key,fixVersions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With