Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Jira Automation: Iterating Over Labels and Extracting Story Points

Mafrik Pranks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2023

Hello Atlassian Community,

I'm currently working on a Jira Automation rule where I need to iterate over the labels of an issue and perform actions based on the presence of a specific label.

I've tried to locate the field Labels and use an if-statement, to see if the 'Labels'-field contained a specfic label, but when it does, I tried to then write {{Story Points}}, but it seems like once I am inside the Labels-field, extracting Story Points from the issue is not possible.

Has anyone successfully implemented a similar automation rule, or can you provide guidance on how to achieve this? Any insights or alternative approaches would be greatly appreciated.

Thank you!

2 answers

0 votes
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.
November 30, 2023

Hi @Mafrik Pranks -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

 

What is the problem you are trying to solve with this rule?  That is, "why do this"?  Knowing that may also provide context.

I suspect your rule is using a list iterator over the labels field to find the value, and then trying to access the Story Points field.  That is not possible with automation rule iterators.

Once inside an iterator, the only scope which is visible is at that level (e.g., Labels) and lower.  The Story Points field is at the same level as Labels, and so is not visible.

Depending on your rule structure and scenario, there may be work-arounds possible.  For example, using the Create Variable action to expand a list with the match() function, or using the replaceAll() function with a regular expression.  Seeing your rule will help to know how to proceed.

Kind regards,
Bill

Mafrik Pranks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 1, 2023

Hello Bill, 

It is as you wrote, I want to sum up all story points in a sprint for each of the different Labels there is.

So I've tried the following:


{{issues}}
{{#labels.match(".*(LabelOne).*")}}
LabelOne: {{Story Points}}
{{/}}
{{/}}

This correctly prints LabelOne: for every story which contains 'LabelOne', however, the Story Points does not show. That now makes sense, if it's not possible to check, because Labels and Story Points are on the same level. 

Is there some way, one could go one step back so to say, so that I could reach the story point section and then print the value?

Hope this helps.

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.
December 1, 2023

Are you trying to sum the story points for the issues with a specific label, or list the individual story point values for issues which have the specific label?

0 votes
Trudy Claspill
Community Champion
November 30, 2023

Hello @Mafrik Pranks 

Welcome to the Atlassian community.

Please show us screen image(s) of the entire rule that you have created so far, and the details of each step.

I also note that you have tagged your post as jira-server. Are you using Jira Server or Jira Data Center, and what version of it are you using? The functionality available in the Automation feature is different depending on your answer.

Suggest an answer

Log in or Sign up to answer