Forums

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

Can you set multiple objects through Jira automation for an Assets field?

Tom Brown
Contributor
October 3, 2023

Hi,

I am trying to set a custom field (Assets object) using Jira Automation. The custom field is configured as Multiple = True. In Jira issues I can select multiple objects in this custom field. In Jira Automation I can only select a single value.

Is this a limitation of Jira Automation or am I missing something. If it is a limitation can anyone help with the JSON to set multiple objects to an Assets field using the Additional fields section?

Thanks,

Tom

1 answer

1 accepted

0 votes
Answer accepted
Tom Brown
Contributor
October 3, 2023

I have the JSON working now but I would still like to know if I should be able to set multiple objects using the 'Choose fields to set' option.

For info the JSON is:

{
    "fields": {
                 "customfield_11810": [{"key" : "TMC-1449"}, {"key" : "TMC-1450"}]
                 }
    }
}

Aleksandra Leesment
Contributor
May 7, 2024

[Solution for Cloud]

Solution above doesn't work when you try to use JSON and Advanced field editing. For me it worked, when I edited the custom object type field and set value as:

key in (object1-key, object2-key, object3-key,...)

Example:

key in (TMC-1449, TMC-1450)

Screenshot 2024-05-07 at 17.10.46.png

You can list all the objects manually or use smart value with the list:

key in ({{your_list}})

NB! If the list has [ and ], then don't forget to remove them. For example, by using .replace():

{{your_list.replace("[","").replace("]","")}}

The end result would be:

key in ({{your_list.replace("[","").replace("]","")}})

And add it as value when editing the field:

Screenshot 2024-05-07 at 17.06.22.png

Like Brent Nye likes this
Brent Nye April 10, 2025

@Aleksandra Leesment , I assume this is Jira Cloud? I'm unable to enter AQL or Smart Values in the field-selection field/box. Thank you.

Aleksandra Leesment
Contributor
April 22, 2025

@Brent Nye , yes, it is Jira Cloud. How does it look when you try to edit this object field in the Edit cell? Please send screenshot. Feel free to edit out the real name of the field.

Like Brent Nye likes this
Brent Nye April 22, 2025

Thanks. If you'll look in the top-right corner of the page we're on now, you will see that this request was for JSM Server, not Cloud. Regardless here's what Data Center (and therefore Server) looks like:

image.png

Aleksandra Leesment
Contributor
April 22, 2025

Oh I didn't notice, sorry! Updated my comment.

What happens if you copy the smart value (e.g. {{your_list}} or {{your_list.replace("[","").replace("]","")}}) from somewhere else and then copy it there and press enter?

Or use advanced editing with JSON? For example like this:

{
"fields": {
"customfield_12345": [{{#your_list.split(",")}}"{{.}}"{{^last}},{{/}}{{/your_list.split(",")}}]
    }
}

Source that I found for list iteration (code block after "Iterates over a list of labels and prints it"). Let me know if it works!

Brent Nye April 22, 2025

I've tried this. A progress indicator spins indefinitely. If I press <Enter> to submit the Smart Value, it doesn't save. The field will only accept Assets objects.

Aleksandra Leesment
Contributor
April 22, 2025

Ah, sorry, I don't know how to help you with this. I'm not as familiar with Server. Perhaps you can reach out to Atlassian support?

Like Brent Nye likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events