Issue REST API, parent fields

krzysztofm121232 April 30, 2018

Is there a way to retrieve a particular parent field?

 

rest/api/2/issue/ISSUE-1?fields=key,fixVersions,parent

I also want to get a field from the parent (say a custom field.)

 

3 answers

1 accepted

2 votes
Answer accepted
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2018

Not in one api call.

Query for the parent from the issue, then hit the API again with the parent issue key.

Griffin Warburton November 21, 2023

5 years later and i think this is possible now.  I added "parent" into the QueryString "fields" list and got the JSON of the parent back in the response

Request
[your-endpoint]/rest/api/2/search/?maxResults=1&fields=parent&jql=[your-jql]

 

Response

"fields": {
"parent": {
"id": "7402702"
}
}
0 votes
mararn1618 _secretbakery.io_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 3, 2021

I am using the JIRA Cloud v3 Rest API and at least the search endpoint supports the "parent" field. Edit: But only for Task/US->Subtask and not Epic->Task/US. 😪

 

 

// see "parent" in fields: ...

let searchRequest: SearchRequestBean = {
jql: `project = ${projectKey}`,
expand: ["renderedFields"],

fields: ["key", "summary", "description", "assignee", "reporter", "watchers", "labels", "issuetype", "comment", "status", "worklog", "parent"],

startAt: dlHandle.currentItemCursor,
maxResults: maxResultsThisRound,
};


let axiosResult = await backOff(()=>{
return this.apiSearchIssues(host.baseUrl).searchForIssuesUsingJqlPost(searchRequest);
},{
startingDelay: FetcherImpl.backoffStartingDelayMS,
numOfAttempts: FetcherImpl.backoffRetryAttempts
});

 

0 votes
Chris _cloud_ Johnson June 8, 2020

I'm seeking a feature request to solve this issue. Please consider upvoting

https://jira.atlassian.com/browse/JRASERVER-71157

Suggest an answer

Log in or Sign up to answer