Hello everyone,
I have a radio-button custom field with the options A, B, C, and D.
I would like to hide a workflow transition when the field’s value is either B or D. Could anyone advise me on how to achieve this? Any help would be greatly appreciated.
We are using ScriptRunner on Jira Data Center v10.3.10.
Best regards
Hello @Sriharsha
There are a few workflow Conditions you can get from ScriptRunner that you could add to the workflow Transition.
The JQL Query Matches condition might be the easiest to understand.
Hi @Trudy Claspill , thank you for your response!
I can still see that transition after adding the workflow condition suggested by you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please show us the details of the Condition that you added.
Note that the link I provided is to an example. You would have to come up with the correct code for your JQL condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sriharsha
With that JQL the transition will be available for
What is the selected value for the radio button in the issue where you see the transition is available, in the XYZ project? And is the type for that issue associated to this workflow?
Are there any other transitions that go from that issues current status to the same destination status as the transition you are trying to hide? Can you show us the workflow diagram for this workflow and point out the transition you are trying to hide?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sriharsha
actually, Scriptrunner Condition on the transition is the way to go. You will have to check for the value of the field. The condition works that the transition will be shown, if the condition returns True. Therefore, you could use a "Simple Scripted Condition" or a "JQL query matches condition". Both are offered by ScriptRunner and both conditions can be tested in the setup screen. As already mentioned, JQL might be easiest, but if you are familiar with Groovy code, the "Simpled scripted condition" is more powerful.
Let me know, if there is any further assistance needed.
Regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Stefan Stadler , I tried using a simple scripted condition, but had no success.
These are the simple scripted conditions I tested:
cfValues['New Hire Computer Type'] != 'B' OR
cfValues['My Select List']?.value == 'My value'
These work correctly for single-select list fields, but they do not work for radio button custom fields.
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.