Forums

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

Copy value from field A to field B ONLY if field A has a value

Brooke Anglin June 19, 2018

We have two fields. Owner Area and Merchant Owner Area. I need a script that will  copy the merchant owner area value to owner area ONLY IF a value was selected in merchant owner area. I am little familiar with the simple scripted language you can use for ScriptRunner but I have idea where to start. Any help would be greatly appreciated !!!

1 answer

0 votes
miikhy
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.
June 19, 2018

Hi Brooke,

There are examples of groovy script all over Community and the web + on ScriptRunner documentation. That's a try-and-try-again approach you should have, the console will allow you to debug and if you have more specific questions we can definitely help!

You might want to start by getting the field value to check if it's empty or not, and then adjust the script to copy it over the second field.

Let us know if you have further questions!

Cheers

Brooke Anglin June 19, 2018

what is the command to copy over a value ? With the simple scripted language I know how check for a null value and I have written an if else script, but is that the best place to put it?

Suggest an answer

Log in or Sign up to answer