I'm making a custom front-end to receive customer tickets for Service Desk (Cloud).
I use a Spring Boot project as a middleware to handle security using basic authentication.
I do my tests for Service Desk in postman before getting them to code.
Using this script in postman (https://myProjectSubdomain.atlassian.net/rest/servicedeskapi/request)
{
"serviceDeskId": "18",
"requestTypeId":"289",
"requestFieldValues": {
[...] a lot of custom fields, all correct,
"summary":"Request summary"
},
"raiseOnBehalfOf":"newCustomerMail@mail.com"
}
It works perfectly, the call returns the newly created request.
But when generating the same request in my java project (Spring boot, using Unirest to handle the REST calls) it returns a HTTP 400 error with error message:
Your request could not be created. Please check the fields have been correctly filled in. Cannot add new customers.
I printed Unirest generated request and it is exactly the same as the one I put in postman.
Furthermore when I remove the part that adds the 'raiseOnBehalfOf' from my java code the request is correctly generated.
Why is it that I can create new users from postman and I can't do it from my java project?
What permissions does your java project have?
This is copied directly from the docs
The fields required for a customer request type depend on the user's permissions:
raiseOnBehalfOf
is not available to Users who have the customer permission only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.