Forums

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

How to block a transition when a ticket has not passed through a given state ?

Nath April 12, 2019

In Jira server, I would like to know if it is possible to block a transition when a ticket has been at a given moment in a given state before its current state (Not necessarily in the previous step, but during all the life of the ticket).


Thank you for your help.

Nath

2 answers

0 votes
PD Sheehan
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.
April 12, 2019

This can also be done with the ScriptRunner add-on if you happen to have that available.

Using the "Simple Scripted validator" (or condition if you prefer to not even show the transition button).

/* The Issue must not have been in Status Draft at any point before its current Status */ 
import com.atlassian.jira.component.ComponentAccessor
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def issueChanges = changeHistoryManager.getChangeItemsForField(issue, 'Status')
!issueChanges.any { it.fromString == 'Draft' }
0 votes
ClaireYang
Contributor
April 12, 2019

Hi Nath,

Do you have JMWE add-on? With this add-on, there is a workflow condition "Previous Status Condition". It may meet your requirement.

Nath April 15, 2019

Hi ClaireYang,

Thank you very much for the help! That's exactly what I want.

Nath

Suggest an answer

Log in or Sign up to answer