Hi,
I have an Workflow and in that from Create ---->Inprogress status I have a Transition called "Approve" I have an Custom Field "Approver"(Single Picker) I want to execute this Transition the User selected in that Custom Filed.
Can any Body provide me condition Script for this or is there any way to do this please suggest me.
Thanks,
Phani
Hi @Daniel Wong I have tried as you suggested but thing is when i select the example of Custom Filed it popup the one line script
cfValues['Some Custom Field'] == 'Some Value' here i made change
cfValues['Approver'] == '10014' after made changes The Transition is Hided even the approver is also not able to see that approver button didnt worked can you please suggest me what exactly I have to do
Thanks,
Phani
Hi Phani,
You need to put in the approver's username in the 'Some Value' field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daniel Wong thanks for your immediate response the thing is for different different issues i will select the different different users in the "Approver" filed so i want the user which i pick in that field that condition have to work.
Example:
In one ticket called "xyz" i selected 'phani' in approver filed
In another ticket called "abc" I selected 'Daniel' in approver filed
here the "approve" Transition should only view for (Phani and Daniel) only this is the condition i want
And also I have tried as you suggested I tried like this
cfValues['Approvers'] == 'Phani' it did not worked the 'Approve' transition is hided even for me the user which i pick in approvers filed for that user also unable to see the transition.
can you please help me how can i apply that condition
Thanks,
Phani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phani,
Please refer to this example provided by Adaptavist - https://scriptrunner.adaptavist.com/5.4.28/jira/recipes/workflow/conditions/current-user-equal-to-cf.html
You should be able to get it working by following that example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phani,
Sounds like you want to restrict the 'Approve' transition to only the selected user in a custom field "Approver". I see you've also tagged this question with ScriptRunner so I'm going to assume you have ScriptRunner installed.
Go to your workflow > Conditions > Add Condition > Script Condition > Simple Scripted Condition > Click on Show Examples. There should be one in there for comparing custom fields.
I suggest going through ScriptRunner's documentation - https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_conditions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.