Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Add priority when creating request via service desk rest api

IT LoQutus 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

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 Leaders.
August 21, 2018

Hello,

You update the priority field like this:

 "priority": {
      "id": "20000"
    }
Joshua Chauvin 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":""} ============ 

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events