Forums

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

Sync between two fields and make one of the field read only

kk4065896 February 10, 2022

Hi All,

I have two custom fields called "cf1 and cf2" . The ask is make cf2 read only and it should update depending on cf1 single select options. Please help me to address this situation. I'm a new bee to the scripting part.

1 answer

1 vote
Pramodh M
Community Champion
February 10, 2022

Hi @kk4065896 

It needs a plugin to achieve the requirement - Scriptrunner!!

Here's an example of how to do that

def fruits = getFieldById(getFieldChanged()).getValue().toString()

getFieldById("customfield_10403").setFormValue(fruits);
getFieldById("customfield_10403").setReadOnly(true)

Script.png

Let me know if you have any queries

Thanks,
Pramodh

Suggest an answer

Log in or Sign up to answer