Servicedesk api how to post and get forms

Tiago Costa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 19, 2024

Hello,

My team and I operate a JIRA Service Desk page where our customers can complete forms to create support tickets.

Presently, I am seeking a method to populate a form via the JIRA Service Desk API. However, thus far, I have been unable to find an endpoint that adequately addresses this requirement.

Firstly, I m trying to find a GET endpoint to retrieve all the form fields that require completion.

Additionally, I need to find POST endpoint to submit a JSON containing the responses, which would then automatically generate the form.

Can anyone assist me with this matter?

Example url of our form and example of one of our forms:
https://company_servicedesk/plugins/servlet/desk/portal/80/create/2803

Screenshot 2024-03-19 at 14.12.52.png

 

Thank you in advance,

Tiago Costa

1 answer

0 votes
Fernando Eugênio da Silva
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 19, 2024

@Tiago Costa , Welcome to the Atlassian Community!

First of all, this is the documentation about REST API and Forms in Jira Cloud: The Forms REST API (atlassian.com)

 

Second, to get all fields filled by forms in your Jira you'll need to give a GET using this informations:

Endpointhttps://api.atlassian.com/jira/forms/cloud/{org-id}/issue/{issue-key}/form

org-id: is the id when you access 'user management' tab. The org-id is the id presented in your URL browser.

https://admin.atlassian.com/s/{org-id}/users?referrerName=JIRA

As this is an experimental API, every time you're using forms API it's required to use the header: X-ExperimentalApi:opt-in

When you did this first GET, Jira will return to you the real form ID. You'will need to use this form ID in the next step to get your forms response.

Screenshot_170.png

---

Forms Response:

Endpoint: https://api.atlassian.com/jira/forms/cloud/{org-id}/request/{issue-key}/form/{form-id}

In this get you'll see all details of the fields in forms and options. The answer you'll see in the final inside state {answers}.

Screenshot_171.png

Is a different structure than Jira, so take some time to read and understand the documentation to GET and to POST values.

Hope these informations helps you anyway,

Let us know in case you have doubts.

Regards,

Fernando

Suggest an answer

Log in or Sign up to answer