Forums

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

Using fieldChange.from to check for a specific label

Norberto Henriques February 9, 2023

I'm trying to use the {{fieldChange.from}} smart value on an automation that is triggered on the "labels" field changes.

The goal is to check when was a certain label added to the labels field.

There is a first condition to check if the labels field includes the label I'm checking.

On a second condition, I'm using this smart value on an "Advanced compare condition" to check if the labels field before the change did not include a specific label. For this I'm using a "does not contain" condition to make sure it does not contain that specific label.

I could have swear that a week ago this was working perfectly, but now I realised that the advanced compare condition is always returning true.

I don't want to check the fieldChange.fromString because I may get false positives if there is a label that partially matches the label I'm checking (ie: alonglabel would give me a false for "long" on a "does not contain" comparison).

So, shouldn't the does not contain comparison work on the raw value for the labels field the way I'm expecting it to work, or do you suggest a different approach for this?

1 answer

0 votes
Magdalena Zhisheva
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.
February 10, 2023

Hi @Norberto Henriques ,

Do you have this optioned checked in your trigger's part of the rule:

Screenshot 2023-02-10 at 18.45.48.png

Norberto Henriques March 2, 2023

Hi @Magdalena Zhisheva .

 

I don't remember using that checkbox, but from what I understood from that this will filter issues so that only those that changed after the last time the rule executed are covered by the rule. Not sure if that's what I need here.

It's odd that using the raw data worked for some time and suddenly it stopped working.

Checking the toString does not do the trick either because there is no guarantee that the text I'm searching will partially match something in the complete string.

Suggest an answer

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

Atlassian Community Events