Forums

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

Updating an insight field via REST API

Koczka Bence May 17, 2021

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
Margo Martis July 21, 2022

@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
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events