I'm trying to set up an integration that allows us to report daily on our current sprint's issues, subtasks and the status of each, using Zapier.
Ideally I'd run some python that loops through the JIRA response I get back to return a list of issues with their name, status, but not if the issue's issue type is name:"Sub-task"
.
The two calls I make are:
- Get active sprint
https://company.atlassian.net/rest/agile/1.0/board/51/sprint?state=active
- Get issues in the sprint
https://company.atlassian.net/rest/agile/1.0/sprint/<value_from_above>/issue?fields=key,status,summary,issuetype&maxResults=200
This gives a JSON output of all tickets, in the following format:
{
expand: "schema,names",
startAt: 0,
maxResults: 200,
total: 97,
issues: [
{
expand: "operations,versionedRepresentations,editmeta,changelog,renderedFields",
id: "43685",
self: "https://company.atlassian.net/rest/agile/1.0/issue/43685",
key: "ENG-431",
fields: {
summary: "Summary",
issuetype: {
self: "https://company.atlassian.net/rest/api/2/issuetype/4",
id: "4",
description: "An improvement or enhancement to an existing feature or task.",
iconUrl: "https://company.atlassian.net/secure/viewavatar?size=medium&avatarId=10610&avatarType=issuetype",
name: "Improvement",
subtask: false,
avatarId: 10610
},
status: {
self: "https://company.atlassian.net/rest/api/2/status/10010",
description: "",
iconUrl: "https://company.atlassian.net/images/icons/statuses/closed.png",
name: "Done",
id: "10010",
statusCategory: {
self: "https://company.atlassian.net/rest/api/2/statuscategory/3",
id: 3,
key: "done",
colorName: "green",
name: "Done"
}
}
}
},
{
expand: "operations,versionedRepresentations,editmeta,changelog,renderedFields",
id: "45729",
self: "https://company.atlassian.net/rest/agile/1.0/issue/45729",
key: "ENG-636",
fields: {
summary: "Summary",
issuetype: {
self: "https://company.atlassian.net/rest/api/2/issuetype/5",
id: "5",
description: "The sub-task of the issue",
iconUrl: "https://company.atlassian.net/secure/viewavatar?size=medium&avatarId=10616&avatarType=issuetype",
name: "Sub-task",
subtask: true,
avatarId: 10616
},
status: {
self: "https://company.atlassian.net/rest/api/2/status/10010",
description: "",
iconUrl: "https://company.atlassian.net/images/icons/statuses/closed.png",
name: "Done",
id: "10010",
statusCategory: {
self: "https://company.atlassian.net/rest/api/2/statuscategory/3",
id: 3,
key: "done",
colorName: "green",
name: "Done"
}
}
}
},
{
expand: "operations,versionedRepresentations,editmeta,changelog,renderedFields",
id: "45727",
self: "https://company.atlassian.net/rest/agile/1.0/issue/45727",
key: "ENG-634",
fields: {
summary: "Summary",
issuetype: {
self: "https://company.atlassian.net/rest/api/2/issuetype/1",
id: "1",
description: "A problem which impairs or prevents the functions of the product.",
iconUrl: "https://company.atlassian.net/secure/viewavatar?size=medium&avatarId=10603&avatarType=issuetype",
name: "Bug",
subtask: false,
avatarId: 10603
},
status: {
self: "https://company.atlassian.net/rest/api/2/status/10010",
description: "",
iconUrl: "https://company.atlassian.net/images/icons/statuses/closed.png",
name: "Done",
id: "10010",
statusCategory: {
self: "https://company.atlassian.net/rest/api/2/statuscategory/3",
id: 3,
key: "done",
colorName: "green",
name: "Done"
}
}
}
}
]
}
Ideally it'd show like the following:
"Issue 1" | Issue type | To do
"Issue 2" | Issue type | In Progress
"Issue 3" | Issue type | Done
"Issue 4" | Issue type | In Progress
Any ideas greatly appreciated, thanks!
Update:
I'm receiving the data back from Zapier in this format (https://i.stack.imgur.com/9Xf18.png), so I'm wondering if those calls should be made in one Python code execution, and parsing the results to give the output listed above.