Having some trouble here and can only find documentation for the server API. I am simply trying to set an insight field when creating an issue via the Jira create api
/rest/api/3/issue
https://confluence.atlassian.com/insightapps/insight-with-jira-rest-api-1085180905.html
Both of the above say to use the following syntax...
{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "REST ye merry gentlemen.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Task"
},
"customfield_10100" : [{"key" : "TEST-1"}],
"customfield_10200" : [{"key" : "TEST-1"}, {"key" : "TEST-2"}]
}
}
So I submitted the following:
{
"fields": {
"customfield_10098": {
"value": "5 Lowest Impact"
},
"customfield_10118": {
"id": "10367"
},
"customfield_10148": "12345",
"customfield_10236": {
"id": "11332"
},
"description": {
"content": [
{
"content": [
{
"text": "job abended",
"type": "text"
}
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
},
"issuetype": {
"name": "Batch Abend"
},
"project": {
"key": "AST"
},
"reporter": {
"id": "61df53ffe76379006871f360"
},
"summary": "job abended please fix",
"customfield_10010": "82",
"customfield_10332": [{"key" : "CUS-63"}]
}
}
The issue gets created but there is no value in the insight object field. All other data is there (including Request Type which is 10010). I tried a number of other things as well (all accepted with a 201 return code):
"customfield_10332": [{"key" : "CUS-63"}]
"customfield_10332": [{"key" : "63"}]
"customfield_10332": [{"objectId" : "63"}]
"customfield_10332": [{"objectId" : "CUS-63"}]
"customfield_10332": [{"name" : "object name"}]
"customfield_10332": [{"Id" : "CUS-63"}]
"customfield_10332": [{"Id" : "63"}]
I am sure I have the correct custom field number as I got the 'not on the screen' message at first before I added the field to the screen. Also here it is via the custom field screen:
So is there a difference in the cloud syntax? Is there something wrong here that I just can't see? Is there a different API I should be using?
I looked through the JSM API but nothing stood out https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/
Hey, @Lewis Martins .
Please, verify if this answer helps to you: https://community.atlassian.com/t5/Jira-Service-Management/JSON-body-example-that-links-an-Insight-object-to-a-JSM-issue/qaq-p/1986713#M101743
"customfield_XXXXX": [
{
"workspaceId": "WORKSPACE_ID",
"id": "WORKSPACE_ID:OBJECT_ID(NUMBER)",
"objectId": "OBJECT_ID"
}
]
How to get WorkSpaceID:
Access the URL: https://URL/rest/servicedeskapi/insight/workspace;
Collect the ID present in “WorkspaceId”.
How to get the ObjectID:
Access the insight and go to the desired object;
The “Object_ID” number is the numbering information that follows the object's key in Insight.
Kind Regards,
Fernando
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.