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:Ā 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Marc -Devoteam-
Community Champion
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-
Community Champion
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
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events