The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Add priority when creating request via service desk rest api

IT LoQutus
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2018

I'll try to perform this basic api request call below. It succeeds when I do not add the priority field:

{
"serviceDeskId": "3",
"requestTypeId": "30",
"requestFieldValues": {
"summary": "Test-Request 2 help via REST",
"description": "I need a new *mouse* for my Mac",
"priority": 1
}

But when I do i'll get the following error:

{
"errorMessage": "Unable to create request because of theses errors : Field with id 'priority' named 'Priority' has these errors : Could not find valid 'id' or 'name' in priority object.",
"i18nErrorMessage": {
"i18nKey": "sd.request.create.error.failed.msg",
"parameters": [
"Field with id 'priority' named 'Priority' has these errors : Could not find valid 'id' or 'name' in priority object."
]
}
}

Can someone explain me what's going wrong here? The priority field is available on the UI.

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 21, 2018

Hello,

You update the priority field like this:

 "priority": {
      "id": "20000"
    }
Joshua Chauvin
Contributor
April 21, 2020

"priority" returns as unrecognized field.

 

The data

$data = '{ "serviceDeskId": "1", "requestTypeId": "1", "raiseOnBehalfOf": "'.$_SESSION['currentUser']['userEmail'].'", "priority": { "id": "20000" }, "requestFieldValues": { "summary": "API Test", "description": "This is a test description" } }';

 

The error message

============ result: {"message":"Unrecognized field \"priority\" (Class com.atlassian.servicedesk.api.rest.dto.domain.request.RequestCreateDTO), not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@c27b48; line: 12, column: 12] (through reference chain: com.atlassian.servicedesk.api.rest.dto.domain.request.RequestCreateDTO[\"priority\"])","status-code":500,"stack-trace":""} ============ 

 

 

TAGS
AUG Leaders

Atlassian Community Events