Forums

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

REST API - Change Queue for request/issue - Jira Service Desk

Paolo Di Bello August 21, 2019

I can get the queues but I cannot put the issue in a certain queue or assign the request to someone.

That’s basically what I want. I want to be able to assign someone to a request, either on the creation of the request or after.

The create customer request only allows you to set a reporter (raiseOnBehalfOf) and requestParticipants.

 

1 answer

1 vote
Michael Kuhl {Appfire}
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, 2019

Hi @Paolo Di Bello - With queues you do not put issues in queues.  Rather an issue will appear in one or more queues based on the filter criteria specified for that queue.  So, make sure your queues are configured so that an issue shows in the queue that you expect.

For updating the assignee you should be able to add the assignee field to the requestFieldValues object and set it there.

PaoloDiBello August 21, 2019

What should I specify in the requestFieldValues ?

an assignee inside?

 

Like this requestFieldValues {assignee: ...}?

Michael Kuhl {Appfire}
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, 2019

Close, but you need to be sure to use quotes:  

 "requestFieldValues": {
    "assignee": "jsmith"
  }

 

Paolo Di Bello August 22, 2019

I tried with the following request and it didn't work as expected:

{
"requestParticipants": [
""
],
"serviceDeskId": "1",
"requestTypeId": "10104",
"requestFieldValues": {
"summary": "I am Fred",
"description": "!!",
"reporter": {
"name": "hateyou"
},
"assignee": {
"name": "hateyou"
}
}
}

I got this error log

{
"errorMessage": "Unable to create request because of theses errors : The field 'reporter' is not valid for this request type 'Email request'.",
"i18nErrorMessage": {
"i18nKey": "sd.request.create.error.failed.msg",
"parameters": [
"The field 'reporter' is not valid for this request type 'Email request'."
]
}
}

I also tried by putting exactly the  code you gave me   

"requestFieldValues": {
"assignee": "jsmith"
}
But I get the following error log: 

{
"errorMessage": "Unable to create request because of theses errors : Field with id 'assignee' named 'Assignee' has these errors : data was not an object",
"i18nErrorMessage": {
"i18nKey": "sd.request.create.error.failed.msg",
"parameters": [
"Field with id 'assignee' named 'Assignee' has these errors : data was not an object"
]
}
}

I think the assignee field needs to be an object.

Thanks in advance! 
Regards

Paolo Di Bello August 22, 2019
PUT /rest/api/2/issue/:issueIdOrKey/assignee

body:

{
"name": "-1"
}

The above api request allows you to set or unset(-1) the assignee but only after the creation of the customer request. 

Suggest an answer

Log in or Sign up to answer