Hello,I want to create a condition:If the workflow goes A-->B--D and back to A the next time it only can go to D (not to B or C)
Something like: if goes from D to A it can only go back to D
Is that possible?
Thanks
Hi Juan, if I understand correctly, you would want the user/customer to transition to a status, and then only allow them to transition back to that status, correct?
If so, then this can be done, as I have implemented this very same behavior for our organization.
To do this, you need to leverage the history of the ticket's workflow and add a condition that will only show the transition if it previously came from the previous status.
Using your example above (D->A -> D), here is a code snippet which shows the condition that needs to be met if the ticket sits in status A. Please keep in mind, this is using ScriptRunner plugin to check for the condition.
import com.atlassian.jira.component.ComponentAccessor //Gets List of all changes to 'status' and takes from last one in the list def changeItem = ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue, 'status')?.last() //variable 'from' is the previous state, 'String' for String type changeItem?.fromString == "D"
HI! Thanks for your answer. And is there a way to do that without externar plugins?
Yes, is correct. If comes from D to A only can go back to D again
Based on my experience, you will need some form of an external plugin, as there is no native way of doing this in Jira.
It looks like you're new here. Sign in or register to get started.