Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Using the automation for Jira add to bulk copy the contents of a labels field into an Insight field

Hi all


I've replaced a labels field with an Insight multi picker field, but I'd really like to backfill the new field with the contents of the old automatically. Now, the automation for Jira plugin doesn't seem to have decent compatibility in terms of smart values with this, or at least I can't find the right syntax of smart value, so it looks like it'll be a case of using the additional fields JSON area.


Does someone have the right format I can try?



2 answers

1 vote
Darryl Lee Community Leader Jan 21, 2021

@Ravi Sagar _Sparxsys_ that is indeed the right format if you already know the asset ID (in your example 4548_11) you want to add to an issue, but since Stephen's question is about trying to backfill an Insight field based on existing Labels, there's a bit more to it.

The problem that I've found in testing is that Insight does not currently expose an API for doing a "search" by object name. You mentioned this yourself here:

I did a little digging though and did discover some interesting things. The Object Schema (project) corresponds to the first 4 digits of an asset ID. Unfortunately this doesn't seem to be stored on the Insight servers, and so you can only figure it out by adding a an asset to an issue and looking at the JSON for an issue, as you described here:

If you can get those 4 digits, then I believe the second digit after the underscore corresponds to the Object Schema "key".

Ok, I think we need some pictures.

Here's my Object Schema named Asset (AS):

Screen Shot 2021-01-21 at 2.39.54 PM.png

I have 3 items, AS-1, AS-2, and AS-3.

Now, I added those items to an "Assets" custom field that I created for HELP-14:

Screen Shot 2021-01-21 at 2.47.25 PM.pngScreen Shot 2021-01-21 at 2.45.49 PM.png

And now, following Ravi's advice, I looked at the JSON representation of the HELP-14 fields by going to, and here's what the relevant custom field data looks like:

Screen Shot 2021-01-21 at 2.46.33 PM.png

So you can see that the 7062 appears to be a consistent "project key", and then after the underscore, we have items 1, 2, and 3.

From this issue, it looks like @djenkins figured out that you actually only need to pass the value keypair to set a field value.

So then, what to do?

Well, depending on your number of Labels/Assets, and if each ticket only has one asset, you might be able to brute-force something in Automation by creating a mapping each label to the appropriate asset key.

With those constraints in mind, I created and successfully tested this very automation:

Screen Shot 2021-01-21 at 3.33.04 PM.png

It's a horrible and frankly unworkable solution if you have more than 3 assets or more than one assets per ticket. But I'm sharing it to hopefully give you some ideas of what you're currently up against if you do try and implement something like this.

I wonder if @Ravi Sagar _Sparxsys_ might have a much cleaner way to do this with Scriptrunner, with maybe a nice way to loop through all the labels, and refer to a lookup table to construct the JSON to update the field? If so, I know I'd love to see it. :-}

Darryl Lee Community Leader Jan 21, 2021

Oh, hey, there's an API for searching for objects, and I think it may work by name:

Well, that certainly opens up some additional possibilities, maybe using web requests.

That is a wonderful idea. Let me try using ScriptRunner to do this more efficiently. 😊

Like Darryl Lee likes this

Hi @Ravi Sagar _Sparxsys_ 


We also have Scriptrunner, let me know if you've come up with something I can use. I'd be very appreciative as interest in copying the old values to the new field is growing :(


also @Darryl Lee you're right, we have hundreds of tickets that have access to around 3500 possible hostnames that I now have objects for in Insight XD



Like Ravi Sagar _Sparxsys_ likes this

Sure don't make it easy do they -_- Hopefully now Atlassian owns mindville and codebarrel they'll make the two work together

It's so much easier to just send the tickets round a global transition using an Insight post function to fill the field. I suppose regardless of whether you use automation for Jira or the global transition, the issue updated stamp will be updated either way, so the same issue of old tickets potentially showing up on boards would be present, might as well do it the simple way. :(

Like Michaël Monserrat likes this
1 vote

Hi @Stephen Letch 

Yes you can. Try this format.

"fields": {

"customfield_10055": [
"appKey": "com.riadalabs.jira.plugins.insight",
"originId": "4548_11",
"serializedOrigin": "com.riadalabs.jira.plugins.insight/4548_11",
"value": "com.riadalabs.jira.plugins.insight/4548_11"


I hope it helps.


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events