Hi all,
I'm implementing an application that, using the JIRA REST API, automatically creates issues: I would also like to assign them to the current active sprint. To do so, I've retrieved the customfield_XXXX code of the "Sprint" field and implemented the following alike body request:
/rest/api/3/issue
{
"fields": {
"project":
{
"key": "SP"
},
"summary": "Sprint issue test",
"description": "REST APIs are great.",
"issuetype": {
"name": "Bug"
},
"customfield_XXXX": activeSprintID
}
}
Still, I need an automatic way to retrieve the ID of the current active sprint and I'm trying to use this REST API to get it:
/rest/agile/1.0/board/{boardId}/sprint?state=active&maxResults=1
which apparently does not work and links me to a dead link.
How can I retrieve the ID of the current active sprint to embed it in the previous body request?
Thanks all,
Andrea
Hi @andrea.giordano -- Welcome to the Atlassian Community!
If you are not using parallel sprints, you may get the current active sprint as you would with a JQL query: sprint IN openSprints() AND sprint NOT IN futureSprints() AND sprint NOT IN closedSprints()
Pleases substitute in your project key.
/rest/greenhopper/latest/integration/teamcalendars/sprint/list?jql=project=myProjectKey%20AND%20sprint%20IN%20openSprints()%20AND%20sprint%20NOT%20IN%20futureSprints()%20AND%20sprint%20NOT%20IN%20closedSprints()
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
~~~
sprint IN openSprints() AND sprint NOT IN futureSprints() AND sprint NOT IN closedSprints()
~~~
doesn't work for items that's been part of more than one sprint and is still active :/
Try using this instead
~~~
sprint IN openSprints() AND sprint NOT IN futureSprints() AND (sprint NOT IN closedSprints() OR (sprint IN openSprints() AND sprint NOT IN futureSprints()))
~~~
And of course, converting it to REST.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @andrea.giordano ,
I found a similar ticket https://community.atlassian.com/t5/Jira-questions/How-to-access-Sprint-details-using-Api/qaq-p/512783
Hope this helps.
Regards,
Kevin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.