Forums

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

Automation Fails on Second Attempt

Helmbrecht, Jim (Synchrony) October 31, 2023

I have an automation that prevents a status change from Backlog to Open unless a certain group of people perform the change.  The transition works ok the first time it is performed on an issue, but when the status is rolled back from Open to Backlog, the status can be moved to Open without the control.  It appears to bypass the rule.   Here is the rule:

Capture_Jira.JPG

 

The error states:

 

Action details:

If block

The following issues passed:
Ticket-4255

Transition issue

No transitions to specified status could be found for issues (with current status):
Ticket-4255 (Open - 1)

Is there a way to force this every time a issue is progressed from Backlog to Open?

3 answers

1 vote
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.
October 31, 2023

Hi Jim,

Welcome to the Atlassian Community!

As already noted, a workflow validator may be better for a scenario like this, and I see you describe why that was not used.

Your rule is using a JQL condition on status and the user performing the change, at any point in time found in the changelog.  That means if anyone who was "authorized" ever performed the transition, the condition will pass as true.

To detect the status transition for this specific rule triggering, please try using a condition on the {{initiator}} smart value instead.  That smart value is the person / user who performed the transition which triggered the rule.

Kind regards,
Bill

Helmbrecht, Jim (Synchrony) November 1, 2023

Bill,  Can you expand on this solution please?  I dont have access to edit the workflow transition and really need to find a way to prevent the status from being moved outside a select set of people.  Thank you!

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.
November 1, 2023

You could replace your JQL condition on status changes to instead check with a User Condition for the person who triggered the rule, compared to your list.

I cannot tell which version of Jira you have (Cloud, Server, Data Center), and so if you do not have the User Condition, you could instead use an Advanced Compare Condition and compare the {{initiator.accountId}} to a list of known user's account id values.

0 votes
Mathew Lederman
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.
October 31, 2023

@Helmbrecht, Jim (Synchrony) the issue is with your JQL function. To get from Backlog to Open the status was changed by the specific group. Since that group made a status change to "Ticket-4255", the ticket will always show when you search status changed by the group. Even if the status has been changed 50 times by 50 different people, it will always have been changed by that group at one point. 

I would recommend setting this requirement on the workflow rather than the automation if at all possible because you're not really preventing the issue from being transitioned, you're just transitioning it back after the transition was complete.

If not, you should be able to use the User Condition, "User who triggered the event".

0 votes
Florian Bonniec
Community Champion
October 31, 2023

Hi @Helmbrecht, Jim (Synchrony) 

The issue is that there is no transition to get back to Backlog.

Because the automation is trigered after the action is performed the automation have to set it back to Backlog.

 

Why are you not using a workflow validator or condition instead ?

 

Regards

Helmbrecht, Jim (Synchrony) October 31, 2023

I think our company has the ability to edit transitions locked down.  I am not able to make changes to the workflow transition properties.  I do have a transition back to Backlog.  Capture_Jira2.JPG

Florian Bonniec
Community Champion
October 31, 2023

Could you try to add the "Re-fetch issue data" action before the transition in the else ?

Helmbrecht, Jim (Synchrony) November 1, 2023

I am struggling to understand the error.  It says the following:

No transitions to specified status could be found for issues (with current status):
Ticket-4255 (Open - 1)
...but I certainly have a transition from Open to Backlog.  I even deleted the transition and added it back to verify.
Florian Bonniec
Community Champion
November 6, 2023

Can you add the log action, and display {{issue.status.name}} to make sure the issue is in teh expected sttaus.

Suggest an answer

Log in or Sign up to answer