Adding label based on already existing labels

Michał Nowak May 2, 2024

Hello Community,

 

Whenever a task is transitioned from a status "In testing" to "To Do", I'd like to add a label that depends on which time such a change occurred, for example:

1st time transition from "In testing" to "To Do" --> add "label-1"

2nd time transition from "In testing" to "To Do" --> add "label-2" and remove "label-1"

3rd time transition from "In testing" to "To Do" --> add "label-3" and remove "label-2"

 

I tried 2 different approaches:

1st approach using advanced branching --> this behaves like a for loop and loops over until final label is reached

1at appr.jpg

2nd approach using if/else if --> this works fine for the first iteration, so it adds the "label-1" but then every time it succeds (success in audit log)  but there's no any change

2nd appr.jpg

 

Looking for any ideas how to fix that!

2 answers

1 vote
Matt Parks
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.
May 2, 2024

In your first condition in the if/else loop, you have both "labels is empty" and "labels is not empty", so it will always meet this criteria. I think you need to adjust that condition.

Michał Nowak May 2, 2024

Hello Matt,

Thanks for your answer - there are OR operators everywhere

Oliver Siebenmarck _Polymetis Apps_
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.
May 7, 2024

Hi @Michał Nowak ,

 I think that's exactly what @Matt Parks  is getting at. Your condition is "labels is empty OR labels is NOT empty", which will always be true. 

If you can rely on the labels being applied correctly, I would build my conditions just with that, like so:

labels not in (label_1, label_2, label_3, label_4, label_5) => add label_1

else if labels = label_1 => remove label_1, add label_2

else if labels = label_2 => remove label_2, add label_3

..and so on. 

Hope that helps,
 Oliver

 

0 votes
Michał Nowak May 6, 2024

Hello,

Does anyone has an idea how to fix that?

Atlassway May 6, 2024

 

Hi  @Michał Nowak 

Try out Colored Label Manager , You can add or remove labels in bulk in two clicks.

Warm Regards

Atlassway Team

Suggest an answer

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

Atlassian Community Events