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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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,555,446
Community Members
 
Community Events
184
Community Groups

Append a value to a custom field of type as an action

Hi,

I'm trying to update a custom field that allows multiple object values, and I would like to add another object when the summary field is updated.

I'm have not found documentation on how to do this on automation, and when I try the following:

{
"update": {
"custom_XXX": [{
"add": {"key":"YYYY"}
}]
}
}

I get an error that the field is not an array.

I guess it is needed to do some JSON manipulation.

How would be the proper way to achieve it?

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 31, 2021

Hello @Miguel Blasco 

Documentation is present here.

I would suggest to make some GET API calls to validate structure of object, allowed values and possible operations. Look for more details here.

Hope this helps to debug your case here.

Cheers
Sherry

Thanks, the field supports the following operations:

"customfield_19430":{"required":false,"schema":{"type":"any","custom":"com.riadalabs.jira.plugins.insight:rlabs-customfield-object-multi","customId":19430},"name":"XXX","fieldId":"customfield_19430","operations":["add","set","remove"]}

and when i try to perform the following action:

 

{
   "update": {
      "XXX": [{
         "add": "YYY"
      }]
   }

 

I got the following error: 

Error editing issuesCLM-636 (data was not an array (customfield_19430))

What am i doing wrong?

Thanks

Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 02, 2021

Hello

Your schema type is "any" not "array", hence you are facing this issue. Might wanna try re-creating custom field of type array and this shall work then.

Sherry

Hi,

Thanks for the input. But would it be possible to do something else on the update action?

This is a heavily used field and changing the type might be not possible at this point.

Thanks and best regards,

Miguel

Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 03, 2021 • edited

For updating Insight fields, might be good to try this: https://documentation.mindville.com/display/ICV53/Insight+with+JIRA+REST-API

Let me know how it goes!

yes , this documentation helped.

FYI you can still have add operations despite having a type "any". the issue was how i was adding the value:

"add": "YYY" -> "add": [{"key": "YYYk"}]

maybe for the future it would be useful to have those links on the automation documentation? Or at least made more explicit?

(It might be the first 2 were visible, but not the latter).

Thanks and best regards,

Miguel

Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 03, 2021

Glad to hear that. Thanks for the update. This work in is progress to put together these docs but yes I will update our technical writer with your feedback. 

 

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events