Forums

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

How to copy custom field value to another custom field

siva
Contributor
November 17, 2021

Hi there,

We are using server version my issue is copy custom field value to another custom field. So here we are using old custom field is Team name field type and it has drop down to select team and my new custom field is Select list Single choice type it also had same drop down names.

We are planning to delete  custom field (Team name field type) because it is not compatible with upcoming jira versions so planning to pull data to new custom field ( Select list Single choice type). Team name field type field used nearly 50thousand issues and i tried script runner built in scritp copy field but no luck. Please help me how to copy these values to new field.

Thanks,

Siva.

2 answers

1 vote
Gaurav
Community Champion
November 17, 2021

Hello @siva 

For this scenario, I can suggest the usage of Automation. The rule can be scheduled to run during non-business hours, for all issues and copy the data from Old Custom Field to the New Custom Field.

Kindly accept the answer if this helps.

0 votes
Nic Brough -Adaptavist-
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.
November 18, 2021

Automation can only copy between fields of similar types, and it sounds like your "Team" field is not a select list.

Scriptrunner's built-in copy has the same limitation, but you can write a script that can convert - instead of "copy Team in field A to field B (a select list)", you need "read Team field, search the options for B to find a matching option, and select that for field B"

Raducanu Octavian Antoniu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 5, 2022

Hi Nic,

Can you provide a script that can do something like you suggested? Same as you said, after running the scriptrunner built-in scripts for copying values from 1 custom field to another (one created with Power Apps Config and the new one created with Scriptrunner - type database picker) I get :


`Error rendering : ORA-01722: invalid number`

 

I tried to run the code provided by scriptrunner from here: https://docs.adaptavist.com/sr4jc/latest/features/built-in-scripts/copy-custom-field-values-to-another-field but the get method seems to not be recognized inside scriptrunner console.

 

Thank you,

Octavian

Suggest an answer

Log in or Sign up to answer