Forums

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

How to autopopulate a new field based on another select list custom field value?

Ankit Jaiswal February 7, 2022

I have a use case.

I have a select list custom field as "Is the plan detailed enough" with values (Yes/No). 

I want to show a new field when No is selected in the field, as "Reason for No" as a text field. 

2 answers

1 accepted

1 vote
Answer accepted
Pramodh M
Community Champion
February 7, 2022

Hi @Ankit Jaiswal 

Welcome to the Community!!

You need a plugin in order to achieve this

  • Scriptrunner
  • Automation for Jira

Scriptrunner example here (https://community.atlassian.com/t5/Jira-questions/Conditionally-set-field-value-based-on-other-field-value-on/qaq-p/460864)

Let me know which plugin you would like to explore with

Thanks,
Pramodh

Ankit Jaiswal February 7, 2022

Hi @Pramodh M 

I am using both the plugins currently. Any solutions for this use case will be welcomed.

Ankit Jaiswal February 7, 2022

Hi @Pramodh M 

The link which you shared has different use case. My use case is related to autopopulation of a new field based on another select list custom field value.

Thanks,

Ankit

Pramodh M
Community Champion
February 7, 2022

@Ankit Jaiswal 

Using Automation for Jira add the below options under a rule

Trigger - Field value changed

Condition - based on your needs

Action - edit the field

For Scriptrunner if you can add behavior

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Thanks

Ankit Jaiswal February 8, 2022

@Pramodh M 

I am new to this groovy scripting, it will be very helpful if you would be able to help me add behaviour for my use case.

Pramodh M
Community Champion
February 8, 2022

Hi @Ankit Jaiswal 

Try the below and let me know if it works

def Cf1 = getFieldById(getFieldChanged()).getValue().toString()
if ( Cf1 == "value"){
getFieldById("Custom field_10302").setFormValue("");

}

 Thanks

Like Marina KOKINA likes this
0 votes
Marina KOKINA December 22, 2022

It works ! Great @Pramodh M !

Thank you !

Pramodh M
Community Champion
December 22, 2022

Great @Marina KOKINA !!

Suggest an answer

Log in or Sign up to answer