How to copy value from one field to another

Vishal Narkhede November 20, 2024

In one of my project, I've created "Account" field as short text instead of dropdown. Post that I've created "Account" with dropdown as well. However, I've to migrate all values from "Account[Short Text" to "Account[Dropdown]". 

I've tried copy from current issue as well as advance field editing, it didn't work.

Below is a json used in edit issue

{ "fields": { "customfield_17052": "Account[Short text]" } }

2 answers

3 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2024

Hi @Vishal Narkhede - 

I think if you really wanted to do this with Automation, you would might be able to create a Lookup Table (I've named it optionMap) to map Short Text (I'm making it "customfield_12345" values to the IDs of all of the Dropdown field options.

Then you would do something like:

{
"fields": {
"customfield_17052": "{{optionMap.get(issue.customfield_12345.value)}}"
}
}

I referenced this: Automation: Set custom field to user input dropdown value 

HOWEVER a much better solution (IMHO) would be to follow @Mayur Jadhav 's advice to use CSV export and import to do this:

Vishal Narkhede November 25, 2024

@Darryl Lee - I've tried to use optionMap however, it's failing with below error.

Configured JSON:

{
"fields": {
"customfield_17052": "{{optionMap.get(issue.customfield_15842.value)}}"
}
}

Error: 

(Specify a valid 'id' or 'name' for Account (customfield_17052))

 

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2024

Doh, sorry, I forgot how to set Single-select fields:

{
"fields": {
"customfield_17052": {
"id" : "{{optionMap.get(issue.customfield_12345.value)}}"
}
}
}

 

Like Steffen Opel _Utoolity_ likes this
0 votes
Megha November 20, 2024

Hello Vishal,

You can use scriptrunner to copy the field value from one field to another. Just filter the tickets and save the filter with a name. 

Go to scriptrunner ----->built in scripts--->copy field values.

You can select the filter id you just saved and source and destination field to copy. 

Hope this helps!!

Regards,

Megha

image (1).png

Vishal Narkhede November 24, 2024

@Megha  - Scriptrunneer is a paid app and our organization is not permitted the same for usage. Is there any other way with which I can get the same output?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events