Forums

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

I Want to give an Condition for a Transition to execute by only Custom Field Users(Single Picker)

Kumar
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.
September 26, 2018

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

2 answers

0 votes
Kumar
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.
October 3, 2018

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

Daniel Wong
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.
October 4, 2018

Hi Phani,

You need to put in the approver's username in the 'Some Value' field.

Kumar
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.
October 4, 2018

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

Daniel Wong
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.
October 9, 2018

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.

0 votes
Daniel Wong
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.
September 27, 2018

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

Suggest an answer

Log in or Sign up to answer