Hi All,
We are planning to restrict the transition of JIRA issues based on the Single Select Custom field Value.
We have a Single select drop-down field which has two values.
Could you please let me know How to implement the above scenario.
Thanks,
Vasantakumaar.
You can do this in two ways, either using the Validator or Behaviour.
The Validator can be used to validate if the required fields are filled else the transition will fail.
A similar function can also be done using the Behaviour.
Below is an example using the Validator:-
1) Select the Simple Scripted Validator
2) Add a condition in the conditions field along with the error message that will be returned.
3) Below is the sample code used for the validator:-
def loggedInUser = Users.loggedInUser
def adminGroup = Groups.getByName('jira-administrators')
def softwareGroup = Groups.getByName('jira-software-users')
cfValues['List2'].value == 'Option1' && (adminGroup.members.contains(loggedInUser) || softwareGroup.members.contains(loggedInUser))
Please note that the sample code above is not 100% exact to your environment. Hence, you will need to modify it accordingly.
When using the Validator, the validation takes place after the transition button is clicked, as shown below:-
I hope this helps to answer your question. :-)
Thank you and Kind regards,
Ram
Hi Ram,
Thanks for the response.
But my request is completely different.
Based on the Custom field value in the single select field, I need to allow certain users to transition from one status to another status.
I have only two values in Custom field Option A & B.
Thanks,
Vasantakumaar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It seems that you will have to use a script in your workflow validator or condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohamed,
Could you please provide let me know which validator or condition I need to use and any sample script available.
Thanks,
Vasantakumaar
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.