IF condition does not find labels that are inserted on trigger issue

Jason M.
Contributor
March 28, 2023

Hello,

Can someone help me understand why the following rule structure is not matching the IF condition for existing labels, when the trigger issue is adding the labels (as created from smart variables)?

1. Description: where regex extracts values after strings, such as New Trunks: and assigns to variable {{newTrunks}}

2. Edit issue drops those smart variables as Labels on the trigger issue. Labels are same as variables, in this case "newTrunks"

3. Issue shows label "newTrunks" after created.

4. IF condition: If label contains "newTrunks", then create a ticket. However, each run automation gives the message:

IF BLOCK
The following issues did not match the condition:
JOF-365
rule.pngticket.png
What am I missing here??
Thanks!

1 answer

1 accepted

2 votes
Answer accepted
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.
March 28, 2023

Hi @Jason M_ 

I am not quite following what you are trying to test...is it:

  • you want to check for a label value named "newTrunks", or
  • you want to check for a label matching the contents of the created variable {{newTrunks}}

 

And one more thing...When using basic conditions, the rule only continues if the test passes.  If instead you have multiple possible conditions, you may want to use the if/else structure, such as the following:

  • if/else condition
    • some condition test...
    • some action...
  • else/if
    • some other condition test...
    • some action...
  • else
    • some action

 

Kind regards,
Bill

Jason M.
Contributor
March 28, 2023

Hi Bill,

 

Thanks for your response, to clarify I'm looking to match the contents of the created variable {{newTrunks}}, which equals the string "newTrunks", and that is added to the label field. 

From my screenshot of the rule above, that label field is updated in the component right before the If:matches condition that is failing. 

I can see the label field is updated with the word "newTrunks" in the trigger issue, yet the If:matches condition still fails to find the label.

I do know the basic condition will fail the remainder of the rule, and am using if/else components to get around that...but here I'm focused on why the condition is not finding the label.

Thanks!
Jason

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.
March 28, 2023

Gotcha, and thanks for clarifying.

When a rule triggers with an issue, the data remains in the as-triggered state even when issues are written out to the cloud/server.  When you want to refresh after an edit, add a Re-fetch action before proceeding.

This works for rules with a simple flow...branches that could be on more than one issue have a different behavior.  I cannot tell from your rule image excerpt if that applies to your situation.

Like Jason M. likes this
Jason M.
Contributor
March 28, 2023

Awesome, that did the trick! Thanks for the explanation as well, much appreciated!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events