Forums

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

Set Multiple Values for Single Attribute in API Call

Chandler Warren
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2022

Hi there,

I've been working quite a bit with the Insight API to create, update, and delete objects. Up to now, I've only been updating attributes with one value at a time. For instance, Display Name : Test Name. However, I have an object attribute that can accept multiple values, both of which are references to other objects. Is there a way to set this through an API call? 

When my colleague initially imported the data via .csv, this could be done with a set of pipes. So a single attribute could take values 112 and 113 as "112||113" and both references would show up for that object attribute. Is there a way to replicate this in the body of an API request so I can edit object attributes with multiple values at once? Or add a value to an existing one instead of overriding it? At the moment, the closest I can get is passing two values at once, but only the last one is the value that shows up for the object. 

Thanks for any assistance,

1 answer

1 accepted

2 votes
Answer accepted
Chandler Warren
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 20, 2022

If anyone stumbles upon this and is wondering the same thing, you just add the second value as another comma-separated value, like so

"attributes": [

{ "objectTypeAttributeId": "265",

  "objectAttributeValues": [

     { "value": "A first value" },

     { "value": "A second value" }

]}]

and the field will have both values. I guess that's obvious now, but I was trying to mimic the .csv upload syntax. Cheers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events