Forums

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

Errors from automation

Mats Rahm January 10, 2024

Hi.

I have built an automation to set or clear a custom field (SAFe Team) depending on the Sprint field. Two teams are working towards a common backlog, and issues assigned to a sprint are either assigned to this first team's sprint or the other team's.

Every time the Sprint field changes, I want to make sure that the SAFe Team field matches the team that owns the sprint or clear the field if the Sprint field is cleared.

My current automation reports some errors from time to time that I do not fully understand. I hope someone here in the community can help.

This is the current automation;

NPS Automation.png

This is an example of how the errors look like;

NPS Typical Error.png

The IF block looks like this with the JQL part shown;

NPS If Block.png

The format of the sprint names is "NPS <team-name>_<period-tag>". Examples are shown below;

NPS Typical Sprints.png

The JQL validates in the automation editor and also works in filters, but I interpret the error message as if the automation detects some kind of problem with this JQL. The group user has the User role assigned in this Jira project.

What am I missing here?

3 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.
January 10, 2024

Hi @Mats Rahm 

I see one problem with your rule and several possible improvements...

The problem is your condition with JQL on sprint IN ("NPS Mavericks").  This type of JQL will perform an exact match on the sprint name, but your sprint names apparently have other characters in the names, such as the program increment information.  You may want to modify that condition to perform a text comparison instead, checking the {{issue.sprint.name}} value.

Please note: that will work if the issues are in one-and-only-one sprint.  When an issue is in multiple sprints, such as with carry-over, the condition will need to account for that.

 

For possible rule improvements:

Kind regards,
Bill

Mats Rahm January 11, 2024

Thanks Bill.

Is the exact match behavior that you are describing special for automation because that is not how it behaves in ordinary JQL queries.

If I write a query sprint IN ("NPS Mavericks"), it will result in matches for all sprints starting with "NPS Mavericks". I was quite surprised by this behavior when I discovered it some years ago. If I click the Validate link when entering this JQL condition in the automation, it shows 280 issues found, so it looks like it works the same way in the automation as for ordinary JQL queries.

I will look at your lookup table suggestion. I am a bit worried, though, from the description that it will result in continuous updates of the table every time new sprints are created. If possible, I would like a solution that will continue to work without updates when new sprints are created.

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.
January 11, 2024

Interesting: I was not aware the sprint field with the JQL IN operator did a fuzzy match.  Thanks!

Regarding the lookup table maintenance, if the structure of your sprint names is predictable, the table content should only need to change when you add a new team (or change the format of sprint names).  For example, your table row keys would be: NPS Mavericks, NPS Ranges, etc.

0 votes
Marc - Devoteam
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.
January 10, 2024

Hi @Mats Rahm 

I would add a create variable action after the condition if project equals NE

set the sprint name of the issue as the variable and use this variable in the IF condition to compare the variable with the Sprint name in the issue.

There could also be a solution to use a lookup action, but this can cause problems as the lookup can only handle a 100 issues

0 votes
Jack Brickey
Community Champion
January 10, 2024

Hi @Mats Rahm , to better analyze can you add the following to your post:

  • the value of sprint for NE-8784 at the time of execution (or whatever issue associated with errored rule). You might consider logging this in the rule before any conditions/actions using the log event action. Useful for troubleshooting. You might also log Safe-team

based on the log and your rule it seems that the safe team would be edited in the first IF statement. Do you know that it was not updated? Can you verify in the History?

Jack Brickey
Community Champion
January 10, 2024

Note: you could also log values at the end of the rule before exiting. This would show the before and after which is very useful when troubleshooting.

Mats Rahm January 11, 2024

Great! I am a rather newbie to Jira automation and was not aware of the possibility of log messages. I have now introduced logging at the start and end of the automation to better understand when I get the error. So far only successful executions, but this will help a lot.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events