Automate set field value - JMWE

RIZKY JTUASIKAL May 15, 2023

I have several fields.

the fields are as follows:

 

Question 1

-Yes

-No

Question 2

-Yes

-No

Question 3

-Yes

-No

 

 

Need Risk.

-Yes

-No

 

How to do it when one of the three questions selects the value Yes,

then the Need Risk field will automatically become Yes.

 

And if all the question fields value is No,

then the Need Risk field will automatically become No.

1 answer

1 accepted

0 votes
Answer accepted
Reshma Begum {Appfire}
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.
May 15, 2023

Hi @RIZKY JTUASIKAL ,

Thanks for reaching out to us!

If you want to update the field value on a transition, then add the Set Issue Fields post function in your workflow.

Please add a Set Issue Fields Post function and under the Add field add “Need Risk“ with the below script:

{% if  issue.fields.customfield_10094.value == "Yes"  or issue.fields.customfield_10095.value == "Yes" or issue.fields.customfield_10096.value == "Yes" %}
Yes
{% elif issue.fields.customfield_10094.value == "No" and issue.fields.customfield_10095.value == "No" and issue.fields.customfield_10096.value == "No" %}
No
{% endif %}

Please modify the custom field IDs in the script

Update and save the post function.

If you want to update the field when one of the fields question1\question2\question3 are updated\modified, then please add a Event-Based Action with Issue Field Value Changed event.

Add the fields Question 1, Question 2, and Question 3 in the Fields to monitor section.

Add the Set Issue Fields Post function similarly as above.

Please let us know if you have any more questions on this.

Thanks,

Reshma

RIZKY JTUASIKAL May 16, 2023

Hi @Reshma Begum {Appfire} ,

 

thank you for your help, it works. :)

I dearly appreciaten your help 

Like Reshma Begum {Appfire} likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events