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: 

Cannot set a request field value by rest API if it is not visible in help center portal

tobiadalsecco
August 27, 2021

I am making an API call 

(https://mou-digital.atlassian.net/rest/servicedeskapi/request) and everything works fine, but if I try to set the "environment" field as a API parameter in the body request, I get the response that the field is not valid for the request type. If I ass it in the help center portal it works fine, but I don't want customers to see it.
What can I do?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 31, 2021

Hello @tobiadalsecco,

Welcome to the Atlassian Community!

When using the /rest/servicedeskapi/request, it’s considered the same as creating the ticket through the customer portal. It means that the fields added to the API request must be the ones visible in the portal.

What can be done, in this case, is to use the Create issue API that is the same as the “Create” button in Jira where you can add the fields available on the screen, even those that are not visible in the portal:

There is only one problem using this endpoint: it’s not possible to set the Request type, therefore, the ticket won’t be visible in the portal and the customer won’t receive the “Request created” notification.

Also, since there is no API to set the Request type after the ticket is created, it will be necessary to manually set it.

Another option is to use the Edit issue API to add a value to the field after creating it using the /rest/servicedeskapi/request API:

Hope this helps!

If you have any other questions regarding this matter, please let us know.

Kind regards,
Angélica

tobiadalsecco
August 31, 2021

Great! I think I'm going to use the edit issue option.

 

Thank you!

Like Angélica Luz likes this