restgetjirajql

How to get all childs of a issue of the gira, using method GET from api rest


I'm trying to get all the children of a task in Jira using the jql from gira, but I can't find a way to pass the jql in the get method. I made progress in passing a jql that references a project but not the children of a task.


Solution

  • "All childs of an issue" means "all subtasks under the issue" and you can get all subtasks by getting the issue object.

    Just send one GET request to /rest/api/2/issue/{issueKey} which returns you a JSON object.

    In this JSON object, there are a "fields" object which contains "subtasks" array.

    Each element of subtasks array contains issue keys for each subtask/child of an issue. Also, it contains some other basic system fields (e.g. summary, assignee) for each issue.

    After getting the subtasks, again you can send a GET request to the same endpoint with each subtask's issue key (/rest/api/2/issue/{subTasksIssueKey}) and you can get all the fields and details for each subtask.