Automation on tagged user

Matthew Young February 17, 2021

Hello all,

I've been playing around with this automation for about two weeks, looked at dozens of posts on this forum, but still can't figure it out so I figured it was time to create my own post. What I'm trying to do is create an automation that transitions the status of a ticket when one of three users is tagged, and then transition again if any of those individuals replies.
For example...
If someone adds a comment and says "Hey @tomsmith, can you take a look at this" the status of the ticket would change to "waiting for response." Then if Tom Smith comments on the ticket saying "Looking at it now" the ticket would change to "in progress"
I'll post the whole automation below, but basically what's happening now is whenever the specific user comments it will satisfy both conditions and go from "waiting for a response" to "in progress" at the same time but I don't know why. Any help would be greatly appreciated!

When: Issue commented

Branch rule / related issues
For Current Issue

     User condition
     If: Initiator is

     Tom Smith
     Terry Shaw
     Cindy Lou

     Then: Transition the issue to
     In Progress

JQL condition
If: Issue matches JQL

comment ~ "tsmith" OR comment ~ "tshaw" OR comment ~ "clou"

Then: Transition the issue to
Waiting for Response

1 answer

0 votes
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.
February 17, 2021

Hi @Matthew Young 

For a question like this, it can help to post an image of your rule to provide some context and to confirm what you are trying to do matches what your rule shows.

I suspect that because you are using a branch, the processing is completing in the branch and then proceeding to do the rest of the logic.  Perhaps you want something like this:

  • Trigger: Issue commented
  • User condition: if user who initiated rules is in (your list of people)
  • Condition (if/else): If status is ??? <<<- this may be a missing part of your rule for entry point checking
    • Action: transition to "waiting for response"
  • Condition (else if): else-if status is "waiting for response"
    • Action: transition to "in progress"
  • Condition (else): else ??? <<<- what do you do in this case?
    • Action: ???

If you specifically want to check the text of the comments (e.g. "can you take a look at this") you may add a Branch and Condition before each Action to transition.

Please also note: a rule like this can be a bit brittle, as your board and workflow outline your process, and now it is also couple to the rule.  Watch for them getting out of sync.

 

Best regards,

Bill

Matthew Young February 18, 2021

Hello @Bill Sheboy
Thank you for your input! I'll see if I can post a picture of my entire automation. I've just blocked out the names of the employees for privacy reasons.

Automation.PNG

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.
February 18, 2021

Thanks for that rule image, Matthew. 

As I suggested, your branch is checking for initiator and then moving issues to "In Progress", and then immediately after it could move things back to "Waiting For ACS Response".

Without too much change in your rule you can fix this as follows (please see the bolded changes):

  • Trigger: when issue commented
  • Branch: current issue
    • Condition: initiator is in your list
    • Action: transition issue to "in progress"
    • Action: re-fetch
  • Condition: if matches JQL... (comment ~ "person a" OR comment ~ "person b" OR comment ~ "person c") AND status != "in progress" 
    • Action: transition issue to "waiting for ACS response"

By the way, branches solve some rule needs and can create other challenges because they run asynchronously: there is no guarantee that they run to completion before the rest of the rule.  The one exception is when the branch has only one issue (such as current issue).  Please watch for this impact in your rules, and the performance issues of branches.

Best regards,

Bill

Matthew Young February 22, 2021

Hello @Bill Sheboy ,

I was trying to add an update yesterday but for some reason the site wouldn't load no matter what I tried. So I took your advice and edited the automation, but I'm still running into some issues where it will make both changes within the same minute. Did I add something incorrectly?

This is the new automation:
New Automation.PNG

But here you can see it making the both changes in the same minute:
Transition.PNG

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2021

Hey Matthew - your last condition is going to process at the same time your branch is going to process since they are in the same level. 

Your re-fetch is on the branch and not the main level so the last part will happen probably before the re-fetch even happens. 

You might want to pull the last part our and do it as a separate rule that would fire based on something that happens under your branch. 

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.
February 22, 2021

Hi @Matthew Young 

Consider what John suggests, or you may remove the Re-Fetch and add to the condition outside of the branch to prevent parallel execution:

  • Condition: if matches JQL... (comment ~ "person a" OR comment ~ "person b" OR comment ~ "person c") AND status NOT IN ("Open", "Reopened", "In Progress", "Waiting for ACS Response")

Of note, and I am hoping someone from Atlassian automation dev team will respond to this question:

The behavior Matthew is seeing does not match the documentation for automation or comments made in this community forum by the dev team members.  Branches which evaluate to one and only one issue are supposed to run in-line and rule processing waits for branch completion to proceed.  The symptom observed indicates this isn't accurate and that branches *always* run asynchronously from the rest of the rule logic.  What is the expected behavior?

Thanks and best regards,

Bill

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2021

@Simmo  - See above

Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2021

Is this server or cloud?

In cloud, I verified behaviour of branch execution is as expected and inline with the document.

Thanks!

Update:
We have raised ticket in backlog: https://codebarrel.atlassian.net/browse/CAVE-3429 to correct document!

Document states that if a branch only has one issue it will be run inline. However, this is not necessarily the case anymore and we can not guarantee the order.

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2021

Hey @John Funk ,

Afraid I'm on paternity leave till April, sorry mate! 

Suggest an answer

Log in or Sign up to answer