Hi everyone,
I need an automation that prevents a subtask from being set to "Done" status if certain conditions are not met (customfield ("LIMS") not yet filled and summary contains certain words ("Data Analysis" and "Data Transfer")). If the conditions are not met, the status should automatically be set back to the previous status. There is always a problem with this step (see screenshot error message).
I have already researched and often read that either the actor of the automation does not have the authorization or the transition is not possible in the workflow. Neither applies in my case.
Any ideas what else the problem could be?
Many greetings
Pauline
Hello @Pauline Hild
Though you say you want to "prevent" the transition with the rule, I see from your additional text that you understand you have to actually undo the transition after it has occurred.
I believe your problem is your use of the smart value {{issue.previous.status}} in this step
Can you show us the details of that step?
Also, can you tell us where you go the idea to use that smart value? I found it mentioned in this post from 2021. However, in that post it becomes clear that it is actually a reference to a custom field named Previous status which has been added to the project issues, and is being filled in during each transition so that there is a record of the previous status for the issue.
Have you created the custom field Previous status and are you setting its value each time the issue is transitioned? If you are setting it, can you provide information about how you are setting it?
I didn't find a way to block the transition, so I thought I could just undo the transition. Is there also a way to prevent the transition directly?
I found the smart value in some other posts, so I thought this must be the right one. However, I don't have a "Previous status" field. Is there a smart value that has this function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pauline,
As @John Funk mentioned you can't prevent a transition with an Automation Rule. Automation Rules run in reaction to an event. If you want to prevent, rather than undo, the transition you would need to modify the workflow transition to the Done status adding Conditions and/or Validators (or Rules, if you are working in a Team Managed project) to prevent the transition.
I have not worked out if the conditions you specified could all be set up between Transition Conditions and Validators (or Team Managed project Transition Rules) with native functionality.
In an Automation Rule, you can use the {{changelog}} smart value to look at changes that were made to the issue. This is mentioned in the documentation for the Issue Transitioned Trigger and more information can be found smart values for Issues documentation .
In this case you would get the numeric value of the previous status using the smart value:
{{#changelog.status}}{{from}}{{/}}
You have to use the Create Variable action to store that in a variable.
Then you can use the variable smart value in the Transition Issue action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created the automation rule as you suggested and with this smart value it actually works, that's awesome! Thank you so much for your help!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pauline,
Automation cannot prevent things from happening, it can only react to things that do happen. You would need a Validator (and/or Condition) on the transition in the workflow to keep it from transitioning in certain cases.
You don't want to just let them move it to Done and then if the criteria is not met, use automation to move it back. Prevent them from moving it in the first place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.