Hi, I’ trying to use the Jira API
``/rest/api/2/search?jql=project={projectId}&expand=changelog&maxResults=100&startAt=0&fields=customfield_10020 ```
to see the issues for a given 'projectId'. I need to see what sprints each issue belong to so I'm including field 'customfield_10020' which is an array of strings containing name, id, state etc of each sprint:
Update:
So I just completed my assignment which was to create a sprint burndown chart for a given projectId (similar to the one in Jira reports).
After a little investigation I found out that the field 'customfield_10020' only contains sprints that the issue is currently part of. For example, if an issue was removed from a sprint then the sprint info will also be removed from ‘'customfield_10020' . So to consider all the sprints an issue has ever been part of you need to look into the history items of the issue as well.
As for my second question, looking at history items whose ‘field’ is ‘Sprint’ does not give you a complete list of all the sprints an issue has been part of. If an issue is directly created in the sprint it doesn’t create a history item, so you have to look at ‘'customfield_10020' and the date the issue was added to the sprint is therefore the creation date of the issue.
For example, it is possible to have an issue like this:
{
“id”: 10,
“fields”: {
"customfield_10020": null,
"created": “2022-01-25T19:02:49.603-0500"
},
"changelog": {
"histories": [
“created”: “2022-01-27T15:02:49.603-0500"
“items”: [
{
"field": "Sprint",
"fieldtype": "custom",
"from": "1",
"fromString": "Sprint_1",
"to": null,
toString": null,
}
]
]
}
}
This issue was created directly in ‘Sprint_1’ at “2022-01-25T19:02:49.603-0500" and then at “2022-01-27T15:02:49.603-0500", it was moved from “Sprint_1” to backlog.
Hi @Mitra Nami
I'm not good with coding and API, so I'd like to propose an alternative solution from my team.
If you're on the cloud, check out the Issue History for Jira app. Here you can easily filter by Project, Assignee, Sprint, and choose any date range you need. As result, you've got a changelog for the list of issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.