Forums

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

Is there a way to have multiple for conditions in the same branch?

Rachel Godina March 26, 2024

Hello,

I am trying to create an automation which will flag tickets when there is an issue blocking them. Once the blocking ticket is completed (or cancelled), the flag will remove from the original (destination?) ticket. I currently have two automations, one which adds a flag to the ticket, and one which removes the flag. 

Adding the flag automation:

  • Trigger: When issue linked - Blocks
  • Condition: For linked issues - Type: is blocked by
  • Condition: Status equals - backlog
  • Action: Edit issue fields - Flagged: Impediment

Screenshot 2024-03-26 at 1.11.29 PM.png

The problem I'm having is that I only want to flag the issue that is currently blocked (not the ticket that is blocking it). I have tried using [Condition: For destination issue] but I can only add it on another branch which makes it look like this and doesn't execute properly (I'm assuming because it's on another branch):

  • Trigger: When issue linked - Blocks
  • Branch 1:
    • Condition: For linked issues - Type: is blocked by
    • Condition: Status equals - backlog
  • Branch 2:
    • Condition: For destination issue
    • Action: Edit issue fields - Flagged: Impediment

Screenshot 2024-03-26 at 1.12.19 PM.png

I'm not sure if that will cause a similar problem with removing the flag from the ticket. What I currently have for that automation is:

  • Trigger: When issue transitioned to - Cancelled, Complete
  • Condition: For linked issues - Type: block
  • Action: Edit issue fields - Flagged: [empty]

Screenshot 2024-03-26 at 1.12.49 PM.png

Is there a way to have both [For conditions] in the same branch or is there another way I can achieve the same result? Thanks!

1 answer

1 accepted

0 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 26, 2024

Hi @Rachel Godina -- Welcome to the Atlassian Community!

I am not following your scenario, so perhaps you can clarify a bit.  I believe you are asking:

GIVEN issue A is in the Backlog status
WHEN issue B links to Block issue A
THEN issue A which Is Blocked By should be marked as Flagged

If you can confirm we can consider rule adjustments.  Thanks!

Kind regards,
Bill

Rachel Godina March 26, 2024

Hi @Bill Sheboy, Thank you for the quick response!

Almost, I would like for it to be when issue B is in backlog status:

GIVEN issue B is in backlog status
WHEN issue B links to Block issue A
THEN issue A which Is Blocked By should be marked as Flagged

Though this way may be more accurate for understanding:

WHEN issue B links to Block issue A
GIVEN issue B is in backlog status
THEN issue A which Is Blocked By should be marked as Flagged

In plain terms, we flag issues that are:

  • currently blocked (issues linked in Is Blocked By)
  • AND the blocking issue is not completed (meaning currently in the backlog)

to ensure that we don't start tickets before completing critical ones.

Thanks again,
Rachel

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 26, 2024

Thanks for clarifying, and...

If you review the details of the Issue Linked trigger, it shows the {{issue}} (also referenced as {{triggerIssue}} ) and the {{destinationIssue}} can be accessed.

For your scenario, you want your status condition on the trigger issue, and then branch to the destination issue to add the flag.  The direction of the links is important for blocking, so please try the behavior to confirm it meets your needs.

Rachel Godina March 28, 2024

Hi Bill, I'm sorry for the delayed response!

I believe I was able to get the initial part of the problem working, the "Flag Blocked Tickets" automation, which is what I was explaining to you before. I used an if-else condition to specify that parameters I explained previously. I have included a look at that below:

Screenshot 2024-03-28 at 1.07.52 PM.png

I tried to use the else in the above automation to remove the flags from the tickets but that didn't seem to have an effect and I wanted to get your input on that. Below, I have included what I attempted to do in the else (continued on after the previous image):

Screenshot 2024-03-28 at 1.08.45 PM.png

THE PROBLEM: How would you remove the flags from the destination issues after the blocking ticket has been transitioned to complete or cancelled? Simplified below: 

WHEN issue B is transitioned to complete or cancelled status
THEN issue A which Is Blocked By should be unflagged

I would like to do this whenever a ticket is transitioned, but unfortunately I cannot specify destination ticket when I am using the the Issue Transitioned trigger. This is why I tried to do this in the else statement from the original automation but the flags were not removing (Flagged parameter is empty in the else statement). Automation below:

Screenshot 2024-03-28 at 1.20.10 PM.png

Do you believe there is a way to achieve this in the "Flag Blocked Tickets" automation (the one with the if-else statement)? If not, how would I do achieve this in a new automation?

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, 2024

As your first rule is triggered by the linking, it cannot also remove the flag: the triggering event is different.

 

For your second rule, you do not need to use the destination issue from the first rule, as the branch can be used instead to find the issue with a condition on Flagged:

  • trigger: transitioned to Canceled or Complete
  • branch: to linked issues, of types "Is Blocked By"
    • condition: issue field Flagged has the value you selected earlier
    • action: edit issue to clear the Flagged field

Have you tried that approach yet?

Rachel Godina April 1, 2024

Yes, I had this originally but in my confusion, I changed it. I have created the automation following the steps you gave and so far everything seems to be working great! I will continue testing and troubleshoot if I have any issues. Thank you so much!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events