The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue REST API, parent fields

krzysztofm121232
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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_
Atlassian Partner
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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2020

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

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

TAGS
AUG Leaders

Atlassian Community Events