Why does Automation cause loop when triggered by IssueCommented?

Chuck Vanderwist December 4, 2014

I want to transition an issue automatically between 2 statuses, each time it is commented on by the assignee, so that it assigns to alternating parties while waiting for their response.

I have a simple workflow that consists of "Waiting for Vendor" and "Waiting for Developer", and "Closed" statuses.

  • I created a Transition from each of the "Waiting" statuses. 
    • Neither have conditions or validators
    • Neither have post function to assign the issue to a user, and update the summary field
    • Destination step is the opposing "Waiting" status (Vendor > Developer) or (Developer > Vendor)

I'm using 2 automation rules in the JIRA Automation plugin to listen for IssueCommented and transition the issue appropriately

  1.  "Vendor Comment" rule
    1. Type = Issue Event Trigger
    2. Event = Issue Commented
    3. JQL is: issuetype = "A Subtask" and status = "Waiting for Vendor"
    4. Restriction: Event author is assignee.
    5. Transition (from "Waiting for Vendor" to "Waiting for Developer")
    6. Disable Notification = Yes
    7. No transition fields
  2. "Developer Comment" rule
    • Everything same as Vendor Comment rule except:
      • JQL is: issuetype = "A Subtask" and status = "Waiting for Developer"
      • Transition (from "Waiting for Developer" to "Waiting for Vendor")

This works as expected, except for one thing.

  • When status = "Waiting for Vendor"  and I log in as the vendor user/assignee, and make a comment:
    • Transitions immediately to "Waiting for Developer"

... perfect... but when I refresh the page...

    • It's back in "Waiting for Vendor"

According to history - the automation is

  1. detecting the IssueCommented event, authored by the Vendor user, who is the assignee and also the user who entered the comment
  2. Completes the transition to "Waiting for Developer", also assigning to the Developer user at the same time
  3. SOMEHOW triggers the "Developer Comment" rule, even though the only comment on record is the one from the Vendor... so we go right back to "Waiting for Vendor"

 

WHY does #3 happen. I feel that by all logic it should NOT, because:

  1. The Vendor is the only person who has ever commented on the issue
  2. The event author and Assignee were both the Vendor (does not match rules for Developer Comment)
  3. The Status of the issue was "Waiting for Developer" (does not match rules for Developer Comment)

1 answer

0 votes
Matej K
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2015

Hi

Maybe it's missing in your description, but in :

2. "Developer Comment" rule

  • Everything same as Vendor Comment rule except:
    • JQL is: issuetype = "A Subtask" and status = "Waiting for Developer"
    • Transition (from "Waiting for Developer" to "Waiting for Vendor")

do you have the "Disable Notification = Yes" ? If not, that might be the reason why it immediately jumps back and forth.


What is also interesting in your setup is the fact that both of your rules react on "Issue commented" event. At the time of execution, the rules are evaluated somewhat sequentially (in order they were updated or created). So if your rule 1 changes the status and then rule 2 is evaluated in the same loop, it is immediately applied. 

Chuck Vanderwist September 10, 2015

I have tried this with Disable Notification = Yes and that makes no difference. I appreciate the insight about the processing... I may support a Jira.atlassian.com support issue to fix this... because by all indications in documentation this problem should be prevented by my JQL that specifically indicates the status on which the automation should be applied.

Suggest an answer

Log in or Sign up to answer