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,323,839
Community Members
 
Community Events
168
Community Groups

Updating an insight field via REST API

I want to change some Object Attributes in an Object Schema. 

I set up a test schema with the default object attributes, plus one text field, which I'd like to change.

Based on the documentation (https://documentation.mindville.com/display/ICV50/Objects+-+REST) I need to make a PUT request to /rest/insight/1.0/object/{id}, which I do with a body of


{    
"objectTypeId"689,    
"attributes": [{        
"objectTypeAttributeId"2727,        
"objectAttributeValues": [{            
"value""plshelp"        
}]
    
}]
}

 

The response status is 200 OK, but It does not affect any changes on the Insight field. The response is exactly the same, as the one I receive when I try to Get an item (/rest/insight/1.0/object/{id}, same exact address, with GET request type). 

Also I noticed, that no matter what I write in the body, the response stays the same, seems like the API does not process it at all. 

The response, if needed(https://pastebin.com/1zh5CCkj)

Any ideas what I am missing here?

1 answer

0 votes

@Koczka Bence, did you get the update working?

We are having the same problem at the moment, get 200 response but insight object isn't updated

We have the code working in automation, but when using scriptrunner the insight object isn\t updated.
Screenshot 2022-07-21 101400.png

 

HttpResponse<JsonNode> response = Unirest.put("https://api.atlassian.com/jsm/insight/workspace/%workplaceID%/v1/object/12701")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.basicAuth("%email%", "%usertoken%")
.body([
attributes: [
{
objectTypeAttributeID: "1601"
objectAttributeValues: [
value: "test2",
]
}
]
])
.asJson()

System.out.println(response.getBody());

Any suggestions?

Suggest an answer

Log in or Sign up to answer