Unable to set Insight Object to Jira Issue.

Apps Management November 8, 2021

Tried to set Insight Object to Jira issue.


PUT https://*****.atlassian.net/rest/api/2/issue/ASA-3

Json Body
{"update":{"customfield_10063":[{"set":[{"key":"INAT-42"}]}]}}

Looks like above one is for Server/Data center.
It's not returning any error . Status Code is 204 No Content.But Insight Object value not set to issue. (Even some value is there it's getting cleared).


Please let us know how to update Insight Object in cloud versions using Rest API?

2 answers

1 accepted

5 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2021

You could use automation to associate the asset with a request. I have an automation that does that for all of our requests. It basically searches Insight for the owner of asset based on the reporter.

Screen Shot 2021-11-08 at 12.24.29 PM.png

0 votes
Robert Wen_ReleaseTEAM_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2021

Unfortunately, the Insight API works with only the Server/Data Center version of Jira Service Management.

dnechayev April 4, 2022

Robert, could you please clarify your response: does it mean that it is not possible to set/update Insight fields in Jira issues - if Cloud Jira instance is being used?

I used different formats suggested in various forums:

customfield_19530: {[{'key':'AZSC-111'}]}
customfield_19530: {[{'0':'AZSC-111'}]}

customfield_19530: {[{'0':{'workspaceId':'xxx','objectId':'xxx'}]}

This is the error I got from the server:

Operation POST rest\/api\/2\/issue failed. Error code: 400 Error: {\"errorMessages\":[],\"errors\":{\"Tenant\":\"expected Object\"}}"

Robert Wen_ReleaseTEAM_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2022

For JSM Cloud it appears that the expected method is using automation as shown by @Mikael Sandberg 's answer.

dnechayev April 5, 2022

Actually, the solution that worked at the end was suggested in this thread:
https://community.atlassian.com/t5/Jira-Service-Management/Jira-API-Insight-object-customfield/qaq-p/1276723:

One trick is to set this value via UI manually for one Issue and retrieve it via "Get Issue" and see what format the value comes back as. Then you can use the same format to send back for new issues.

This is the format that worked. I still wonder why this is not documented anywhere

"customfield_19521": [
{
"workspaceId": "xxx",
"id": "xxx:11147",
"objectId": "11147"
}

Suggest an answer

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

Atlassian Community Events