Forums

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

Can you use the JIRA REST API to show more subtask fields?

Nathan Beigel June 8, 2018

When I receive results from the JIRA REST API that include issues with subtasks, the returned subtask objects only contain the issuetype, priority, status, and summary fields like this:

{
issues: [{
key: ...,
fields: {
summary: ...,
subtasks: [{
key: ...,
fields: {
issuetype: ...,
priority: ...,
status: ...,
summary: ...
}
}]
}
}]
}

 

Is it possible for the API to return the duedate field for subtasks as well or do I need to make a subsequent request to see additional fields? 

1 answer

1 accepted

0 votes
Answer accepted
Mirek
Community Champion
June 9, 2018

Probably you reach info from parent where in normal view screen you get only some fields. Sub tasks are like normal issues, but maybe it would be better to read and gather sub-tasks keys from a parent and later get info like normal issue using those keys. Then you should get all info including due date (if this field is used in sub-task)

Nathan Beigel June 11, 2018

Thank you. So to confirm, the JIRA REST API doesn't have a method to request additional fields in subtasks, i.e. an "expand" option?

Nic Brough -Adaptavist-
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.
June 11, 2018

No, it's the opposite.  Jira considers sub-tasks to be issues in the same way as their parents, barring the sub-task part (which can be simplified down to "they must have a parent issue").  The expand option in the REST API works the same for sub-tasks, because they're still issues in their own right.

Nathan Beigel June 11, 2018

Thanks for the feedback.

I'm specifically referring to the issue objects contained within the "subtasks" field of a parent issue. These subtask objects only contain the issuetypeprioritystatus, and summary fields. Is there an expand option that will returns more fields beyond these for subtask objects?

Nic Brough -Adaptavist-
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.
June 11, 2018

No, because you're looking at a parent issue, not the subtasks, when you use that.  The four fields includede are a convenience to help out a couple of the dashboard gadgets.  If you want more, you need to read the sub-tasks.

Nathan Beigel June 11, 2018

Got it. Thanks a lot for the confirmation.

Suggest an answer

Log in or Sign up to answer