The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Updating Insight Object using REST API having the unlimited cardinality

Adrian Citu
September 6, 2023

Dear Community,

Here is my problem: I have an Insight Object that have an attribute having the cardinality "unlimited"; meaning that it can contains more than one value.

Now, I would like to update this attribute programmatically (using a REST API call/s) by adding new values to the already existing ones.

If I use the "Update Object" REST API (https://docs.atlassian.com/assets/REST/10.7.0/#object-updateObject) it will replace the old attribute value/s with the new ones but in my case I would like to add the new values to the previous one/s.

An idea would be to use "Load Object" REST API and retrieve the original attribute values and then use the "Update Object" REST API with the old values plus the new ones but it looks to my kind of over killing.

Any hints would be helpful.

thx,

Adrian

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Gonchik Tsymzhitov
Community Champion
September 7, 2023

Hi @Adrian Citu , 

could you try to get object by id? 

and then get values and after add you values into adjusted object. 

Adrian Citu
September 8, 2023

Hello,

This is what I have done in the end but I find it cumbersome knowing that I have to do this from automation (trigger a GET call and parse the result).

On the other side I've seen this attribute into the JSON request schema of the update object REST API :

                    "operationType": {
                        "type": "integer"
                    }

I wonder what it really means; I blindly tried to use it with integer values but it did not changed anything.

 

I think the API should let the user choose, either overwrite the initial values or add on top of them; both actions are updates of the object.

 

thx,

Adrian

TAGS
AUG Leaders

Atlassian Community Events