Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Issue with cfValues script in Post Function for Cascaded Single Choice and Single Choice field.

RG December 4, 2019

Hi,

I am writing Post Function script to set value of system field based on other two custom field values. I have 3 fields  America, India and Europe

 

America is Cascaded Single Choice Field

India is Single Choice

Europe is Single Choice

 

Cascaded Field for America are FA1 and FA2

FA1 values : A, B, C
FA2 values: Values for A (A1,A2,A3)
Values for B (B1,B2,B3)
Values for C (C1,C2,C3)

Values of India : X, Y, Z
Values of Europe : AA, BB, CC, DD

I am setting issue security Lock in Workflow as Post Function via scriptrunner (cfValues Script). Below are the conditions:

1. Set Europe value to AA (condition applies) when user select below America Values


America (FA1)  ='A'
America (FA1) = ‘B’
America (FA1) = ‘C’

2. Set Europe value to BB if user select India Values to India value X

India = X

3. Set Europe value to DD if user select India value X and America value to A, B and C

India= X
and
America (FA1)  = A
America (FA1)  = B

America (FA1)  = C

4. Set Europe value to CC if user select India value Y

India = Y

Please help me ASAP, as its urgent and we need to implement this on our PROD.

------------------------------------
Tried with below cfValues script functions:

def list = ['A','B','C']
cfValues['America']?.get(null)?.value in list

cfValues['India']?.value == 'X'

def list = ['A','B']
cfValues['America']?.get(null)?.value in list && cfValues['India']?.value == 'X'

def list = ['Y']
cfValues['India']?.value in list

 

All are working except condition 3. In condition 3rd issue taking 2nd condition value.

 

1 answer

0 votes
RG December 4, 2019

Dear Experts, Any Idea?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events