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
4,359,742
Community Members
 
Community Events
168
Community Groups

How to add more values to the custom field without overwrite previous value?

Hi all, 

I have a specific task to do. I have to create an automation for multiple squads and when each squad chooses the option "approved", the squad name should appear in another field. I did it for one squad and it was working perfectly. See attached picture. 

 

Screenshot 2022-08-11 122917.pngBut when I tried to add another team, the first team name in the field was replaced with the second one instead of keeping both names. See attached picture. 

Screenshot 2022-08-11 123818.png

More names can be added to the field manually, so this is not a field limitation. 

I was experimenting with different custom fields (currently I use the custom field "select list - multiple choices) but without success. Then I tried to experiment with advanced field editing with JSON. But I'm still new in Jira and not that experienced, so I need help. I found something that could work for my case but after many tries didn't work at all.

https://community.atlassian.com/t5/Jira-Software-questions/Automation-Advanced-field-editing-JSON-add-multiselect-values/qaq-p/1934405#U2104772 

Also, you can see my automation here

Screenshot 2022-08-11 124833.png

As well as my audit log error

Screenshot 2022-08-11 124942.png

 

Please advise and if you need more information, I would be very happy to provide. Thank you very much. 

BR, 

Sinisa

1 answer

0 votes
John Funk Community Leader Aug 11, 2022

Hi Sinisa,

Not sure why you would need to use #lookupIssues. What if you just did this:

{

      "update": {

        "customfield_10155": [{

                "add": "Navy"

        }]

}

Hi John, 

 

I really appreciate your suggestion. I've tried and it didn't work, unfortunately, here is the

audit log error 

Screenshot 2022-08-14 153951.png

John Funk Community Leader Aug 15, 2022

Ah, looks like I missed one more curly bracket at the very end when I cut and pasted. Ad one more } and a new last line or one beside the very last one and give that a whirl. 

Like this maybe? didn't work either

 

{

"update": {

"customfield_10155": [{

"add": "Navy"

}]

}}

John Funk Community Leader Aug 15, 2022

Same error? 

Yes, this is the error

Screenshot 2022-08-15 165234.png

John Funk Community Leader Aug 15, 2022

Okay, that's a different error. What exact type of field is customfield_10155?

A field for multiple choices

John Funk Community Leader Aug 15, 2022

But can you tell me the exact type that Jira calls it? 

Maybe this will help because I don't know the exact name

Screenshot 2022-08-15 170103.png

John Funk Community Leader Aug 16, 2022

Let's try this:

{
"update": {
"customfield_10155" : [
{
"add": {
"value":"Navy"
}
}
]
}
}

Like Sinisa Glusac likes this

Hi John, thank you very much, I just tested it and it works perfectly!!! I really appreciated your help, you made my day! 

 

Cheers, 

Sinisa

Like John Funk likes this
John Funk Community Leader Aug 17, 2022

Great! I am glad that worked, and it helped you out.  :-)

Like Sinisa Glusac likes this

It helped a lot, later I was using the same JSON but for different reasons, and slightly modified. For instance, if some squad later chooses instead of "Approved" something else, such as "Not required" or "To be clarified" then the name of the squad has been removed from the field. So I used this:

{
"update": {
"customfield_10155" : [
{
"remove": {
"value":"Navy"
}
}
]
}
}

(remove instead of add) and also works perfectly!

So once again, thank you very much for this brilliant work. 

Like John Funk likes this
John Funk Community Leader Aug 18, 2022

Great! Glad it is working for you!

Like Sinisa Glusac likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

4,955 views 18 31
Read article

Atlassian Community Events