Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Update asset object using the rest api

Steven Vits
Contributor
June 20, 2024

I'm trying to create an automation that updates an asset object.

Using the rest API was mentioned on this page somewhere.

using postman to test to. 

https://api.atlassian.com/jsm/assets/workspace/v1/object/{{ObjectList.key}}

with the next payload:

{ "attributes": [ { "id": "76270", "objectAttributeValues": [ { "Value": "8" } ] } ] }

I do get an '200 ok' response but the object is not updated.

Does anyone can inspire me please?

2 answers

1 accepted

1 vote
Answer accepted
Steven Vits
Contributor
June 21, 2024

{
"attributes": [
{
"objectTypeAttributeId": "48",
"objectAttributeValues": [
{
"value": "8"
}
]
}
],
"objectTypeId": "37"
}

seems to be the correct payload

reference: The Assets REST API (atlassian.com)

0 votes
Qusai Atoon January 23, 2025

Hello Dears, 

I hope this message finds you well. 

 

I feel like there is something that I don't get, since I have the same issue described in the question. 

 

I have a field in my object that has the type (Default) and Type Value (Text). 

I'm using the below Request:

URL

https://api.atlassian.com/jsm/assets/workspace/{{WSID}}/v1/object/[OBJECT_ID]

Body:  

{

    "objectTypeId": "7",

    "attributes": [

        {

            "objectTypeAttributeId": "103",

            "objectAttributeValues": [

                {

                    "value": "This field was edited using REST API."

                }

            ]

        }

    ]

}

and I also get 200 OK Response Code, but the returned edited object is still the same as it was before, no changes on the UI either. 

I also tried sending the request without the request body and it behaved the same. 

 

If anyone was able to figure it out, can you please advise regarding your resolution?

I'll keep trying to figure it out, and if I crack it, I'll share my finding. 

 

Thanks, 

Qusai Atoon.  

Qusai Atoon January 23, 2025

I figured it out, I was using the HTTP verb "GET". 

 

 

Suggest an answer

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

Atlassian Community Events