Copy text field value to asset field
Asked by Kristin Lyons:

We are on Jira Data Center and we are looking to copy a text field to an Asset field. We do have ScriptRunner if we need to utilize that. I tried using ScriptRunner's Copy Field Value and also a CSV import to copy the data but neither worked.


Answers:
author: Hannes Obweger - JXL for Jira
body: Hi [@Kristin Lyons](/t5/user/viewprofilepage/user-id/5406781)

depending on your exact use case, you may want to have a look at the app that my team and I are working on, [JXL for Jira](https://marketplace.atlassian.com/apps/1224710?hosting=datacenter&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2786689).

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields - including asset fields - much like you'd do in e.g. Excel or Google Sheets. It also allows *bulk editing* your issue fields via copy/paste. This works *within* your fields in JXL, but also *across* fields, and even across fields of different types. This is how it looks in action:

![copy-paste-text-to-assets.gif](https://community.atlassian.com/t5/image/serverpage/image-id/344581i635D09B748125C82/image-size/large?v=v2&px=999 "copy-paste-text-to-assets.gif")

In the above clip, Inventory is an assets field, and Notes is a text field. As you can see, JXL successfully maps the text to asset objects - it really only requires the text items to "match" assets.

This works for any number of issues per action, so assuming that your data is generally valid, you should be done in no time. If your data doesn't quite match, you can also copy the text to e.g. Excel, make any changes there, and then copy back into JXL.

I should also add that JXL can do much more than the above: From support for configurable *issue hierarchies* , to *issue grouping* by any issue field(s), *sum-ups* , or *conditional formatting* .

Any questions just let me know,

Best,

Hannes


author: Ram Kumar Aravindakshan _Adaptavist_
body: Hi [@Kristin Lyons](/t5/user/viewprofilepage/user-id/5406781)

Welcome to the community.

In your description, you mentioned:-
> We are on Jira Data Center and we are looking to copy a text field to an Asset field. We do have ScriptRunner if we need to utilize that. I tried using ScriptRunner's Copy Field Value and also a CSV import to copy the data but neither worked.

Based on what conditions do you intend to copy the text field to an Asset field?

Also, what Asset type are you using, and do you intend to use the value in the text field to update an Asset's property?

Please provide these details and I will prepare an example if it is doable.

I am looking forward to your feedback and clarification.

Thank you and Kind regards,  
Ram

comments: author: Kristin Lyons
body: * We want to change all data in the former text field to the asset field, the assets should have all the options available that were used in the text field.
* We are using Object Type and default/text for the type and type value


author: Adolfo Casari
body: [@Kristin Lyons](/t5/user/viewprofilepage/user-id/5406781)Try scriptrunner HAPI, make what you're looking for very easy.

comments: author: Kristin Lyons
body: This actually looks incredibly helpful. Is it possible to find the text field and then match it automatically with the Asset?


Tags: assets

automation

data-center

jira-data-center

jira-service-desk-data-center

jira-service-management

jira-service-management-data-center

scriptrunner