How to change sprint in JIRA automation based on name and not id?

Patrizia Heinzl March 27, 2024

Hello,

I need to change the sprint of an issue with automation.

However instead of using the sprint ID, I want to use the name of the sprint. Is this possible?

 

Unfortunately below example does not work. I tried a few other things but not sure if its even possible to do this without using the sprint ID?

 

{ "fields" : {
"customfield_10005" : [{"name" : "Existing Sprint name"}]
}
}

 

I get the error message: 

Error occurred setting field 'customfield_10005'. It will be ignored. (customfield_10005)

---------------

Info:

I have certain releases mapped to specific sprints.:

e.g

Release name: R23/22 > Sprint name: Sprint R23/22

Release name: R23/23 > Sprint name: Sprint R23/23

 

> As soon as the release of an issue changes, it should also change to the corresponding sprint.

> Since the sprint has the release in its name, it would be a lot easier using the names instead of mapping each release separately to each sprint ID.

3 answers

2 accepted

3 votes
Answer accepted
Bill Sheboy
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.
March 27, 2024

Hi @Patrizia Heinzl 

No, but the work-around for that scenario is to lookup the id needed from the name:

  • call the REST API function to get all sprints for your board, using the Send Web Request action
  • filter the list by your name, and grab the id for use to set the field

 

If you want to try that approach, here is a how-to for calling the REST API functions from a rule and the other documentation you will need:

Kind regards,
Bill

Patrizia Heinzl March 28, 2024

Awesome, that's a great Idea! I will try this. Thank you!

Like Bill Sheboy likes this
1 vote
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2024

No, it is not possible to use the name instead of the sprint Id. The reason is that the sprint name isn't unique in your instance, you could have two or more sprints with the same name.

0 votes
Kalyan Sattaluri
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.
March 27, 2024

Hello @Patrizia Heinzl 

*I am ashamed to suggest this*

Another option,  which by passes API call is to,

create a place holder / dummy story in every sprint which will be discarded eventually.

That way, when release is updated on any story, you can do a lookup of issues in that sprint, which gives you the dummy issue and you can get the sprint ID from that.

{{#lookupIssues}}{{#sprint}}{{#if(equals(state,"active"))}}{{id}}{{/}}{{/}}{{/}}

Which you can use to edit your trigger issue..

/hides

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events