I need to create a request using the servicedeskapi api, the problem is that I can't use the custom fields of the request type.
Through the console I have 2 custom fields (Services and Product/Platform), the problem is that when I use the endpoint to bring the available fields "servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field", it only returns summary, description and attachment, which are the default fields.
Can anyone tell me if this is possible using servicedeskapi?
@Bruno Oliveira , Welcome to the Atlassian Community!
To create a request by REST API you need to consider the API for Jira Cloud in Jira Service Management here
Also, you need to pass the correct JSON observing the requestFieldValues input format. The doc explain how to do that. If you're not confortable using REST API the safe way is first create an issue with all values you want by jira itself, do a GET by API and collect the correct JSON structure for all field types you want.
Hope this helps,
Fernando
Hi @Fernando Eugênio da Silva, thanks for the reply.
The method I'm using is the same.
It turns out that I need to create the request with the "Services" and "Product/Plataform" fields filled in. But as I said, through this informed method I can only fill in the standard fields (summary, description and attachment).
I managed to create it manually through the Service Desk console and then do the GET through the API to see how the fields are filled in, but the custom fields do not return in the get request method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I realize that your fields are associated with a forms applied to the Request Type.
Are these fields configured in Forms associated with Jira fields or are they just fields created from forms without being linked to Jira fields?
Also, can you share the Payload you are using in the request? So I can test over here and see what's going on
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did a test by creating via console and filling in all the form fields as you can see in the print below.
It turns out that when I get this request, these custom fields do not appear as you can see.
I believe they are fields unrelated to jira forms, because for each chosen category a different form template appears.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Forms appears like this on the request page. It's a custom form.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to associate these Forms fields with Jira fields. That's because Forms fields work in a different way that somehow doesn't 'consume' Jira's base fields globally.
Go to 'Project Settings' > Forms > Access the form and the field you want, when clicking on the field in Forms you will have the option 'Linked Jira Field', the form field needs to be associated with a Jira field with the same options. Only when you have a Jira field with the values and associated with a form field will you be able to create REST API issues with these custom fields.
Here to know How to Link a form field to a Jira field.
There's an Atlassian Ticket opened to expand Forms resource using REST API: JSDCLOUD-10671. But now, to create issues by REST API using Forms, you need to link a jira field into a jira field forms firstly.
Any questions, let me know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.