Forums

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

Service Desk API - Request creation failed.

nicola.dauria October 15, 2024

Hi everybody,

i'm facing an issue when i try to create a request by servicedesk api.

The create request returns me a 301 status and then redirect to another service and returns a different result which is a list of ticket from a GET service.

Can you help me finding the mistake I'm making?

Thanks.


These are the api call url and its body. 

domain.atlassian.net/rest/servicedeskapi/request 

{
"requestFieldValues": {
"summary": "summary",
"description": "description",
"customfield_10092": "url",
"priority": "1",
"customfield_10093": "Niconize",
"canRaiseOnBehalfOf": true

},
"canRaiseOnBehalfOf": "user_id",
"requestParticipants": ["user2_id"]
}

Same issue when I try to comment a ticket

domani.atlassian.net/rest/servicedeskapi/request/25536/comment

1 answer

1 accepted

3 votes
Answer accepted
Marc - Devoteam
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.
October 15, 2024

Hi @nicola.dauria 

On creation you also need to specify the following, request id and the id of the service desk.

  • "requestTypeId": ""
  • "serviceDeskId": ""

On comment you need to provide the body and if the comment is public or true or false

nicola.dauria October 15, 2024

Hi Marc, 
thanks for reply.

I added the missing fields but nothing has changed.

Do you have any other suggestion?

 

Marc - Devoteam
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.
October 15, 2024

Hi @nicola.dauria 

what are the exact API calls you are making for both actions?

nicola.dauria October 15, 2024

Hi @Marc - Devoteam,
these are the links to api i'm using:

Create request: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-post

Add a comment: https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-comment-post

URLs are in the issue description.

The user that i'm using to execute these calls is mine who is a Agent user and not a customer. Can be this the 301 status cause?  

nicola.dauria October 15, 2024

Hi @Marc - Devoteam
i may found a way to resolve the issue. I was basically missing the https protocol at the beginning.

Now  i'm getting a 400 status and a response body:

"errorMessages": [

"Invalid request payload. Refer to the REST API documentation and try again."

]

Any suggestions?

Thanks for the support.

nicola.dauria October 15, 2024

Hi @Marc - Devoteam
nevermind, i resolve all the issue i was facing. :)

The priority expected an object as it follows: 

"priority": {

    "id": 1,

 Thank for the support you provided me!

Regards :D 

Like Marc - Devoteam likes this

Suggest an answer

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

Atlassian Community Events