Forums

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

Jira automation: Trigger if a certain label was added (with a twist)

Robin Powell
Contributor
April 6, 2022

I have a rule that I want to trigger if a certain label was added to an issue. I can do that, but the problem I'm having is that there are several labels that could be added, and 3 of them have letter combinations in common. One is for a larger program "ABCD". That program has 2 subprograms, "ABC" and "CD". Any of those could be labels, and multiple labels can be applied.

An example of a case I'm having trouble with - one rule looks for the addition of the label "CD":

Original label: "ABCD"

Updated label: "ABCD", "CD"

Here's what I'm doing.

Jira_automation_ARGH.jpg

In this case, the rule fails to add the comment because it thinks "CD" existed in the original label. Is there a way to access just the part of the label that was added? I've messed around with {{fieldChange.toString}} - {{fieldChange.fromString}} (which doesn't seem to do what I'd hoped) and now I'm heading down the rabbit hole of regular expressions, so I figured I'd ask here and see if anyone has any suggestions. (Am I missing something simple?)

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

FWIW, we use a Data Center instance, not Cloud. I am unable to change the names of the projects or the labels used. Also, "ABCD", "ABC", and "CD" are not the actual project names.

1 answer

0 votes
Sam Bartolome
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.
April 8, 2022

Hi @Robin Powell ,

The automation is set as label contains any of CD, so it checks for any label with these 2 works like ABCD and CD, both match.

The condition should read as equals CD instead of contains and that should do the trick

Suggest an answer

Log in or Sign up to answer