API Customer Requests with Forms and Assets in JSM Cloud

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Use custom fields from Assets objects in JSM Cloud Forms to enhance your request submissions.

Solution

Getting Forms IDs

On our API documentation, there is an example of how to create a request with Forms linked to a Request type:

In order to get the options and types to add Forms on the API, you need to:

Get the Form ID:

cURL (terminal) example:

curl --request GET \ --url 'https://api.atlassian.com/jira/forms/cloud/<cloudid>/project/<pkey>/form' \ --user '<email>:<token>' \ --header 'X-ExperimentalApi: opt-in' \ --header 'Accept: application/json'

Alternatively, via Automation's Send Web Request Action:

Automation Example:

Web request URL* (required): https://api.atlassian.com/jira/forms/cloud/<cloudid>/project/{{project.key}}/form HTTP method* (required): GET Web request body* (required): Empty Delay execution of subsequent rule actions until we've received a response for this web request: Checked Continue running the rule even if the request response is not successful (i.e. non-200 response): Unchecked Headers (optional): content-type: application/json X-ExperimentalApi: opt-in Authorization: Basic {{base64Encode('<email>:<token>')}}

Get the Form’s field ID:

cURL (terminal) example:

curl --request GET \ --url 'https://api.atlassian.com/jira/forms/cloud/<cloudid>/project/<pkey>/form/<form id>' \ --user '<email>:<token>' \ --header 'X-ExperimentalApi: opt-in' \ --header 'Accept: application/json'

Alternatively, via Automation's Send Web Request Action:

Automation Example:

Web request URL* (required): https://api.atlassian.com/jira/forms/cloud/<cloudid>/project/{{project.key}}/form/<form id> HTTP method* (required): GET Web request body* (required): Empty Delay execution of subsequent rule actions until we've received a response for this web request: Checked Continue running the rule even if the request response is not successful (i.e. non-200 response): Unchecked Headers (optional): content-type: application/json X-ExperimentalApi: opt-in Authorization: Basic {{base64Encode('<email>:<token>')}}

The Assets objects field displays only the custom field ID and name. Unlike other fields, Assets require a combination of the Workspace ID and Object ID instead of just adding "choices" and a number, as shown in the API documentation.

Getting Assets information

Workspace ID

The Workspace ID can be retrieved via API or by exporting an issue that already has an Assets field.

Via API, you just need to change the <site> to your instance domain and paste it to your browser:

https://<site>.atlassian.net/rest/servicedeskapi/assets/workspace

Object ID

This value is easier to get as it’s the number on the Object Key.

A list of two servers with their icons, keys (IT-55 and IT-56), and names (Dell PowerEdge VRTX and HPE ProLiant DL580 Gen9).

Once you have these two details, you can raise the request using the Forms + Assets fields.

cURL (terminal) example:

curl --request POST \ --url 'https://<site>.atlassian.net/rest/servicedeskapi/request' \ --user '<email>:<token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "form": { "answers": { "1": { "text": "Answer to a text form field" }, "4": { "choices": [ "123ed45a-6f7d-8c9c-bc10-c123b4567891:55" ] } }, "requestFieldValues": { "description": "I need a new *mouse* for my Mac", "summary": "Request JSD help via REST" }, "requestTypeId": "25", "serviceDeskId": "10" }'

In the above example, we have 123ed45a-6f7d-8c9c-bc10-c123b4567891 as the Workspace ID and 55 as the Object ID. The screenshot refers to the IT-55 object.

This said, when raising requests via API with Forms that contain Assets fields, the format will be “workspaceid:objectid” - "123ed45a-6f7d-8c9c-bc10-c123b4567891:55".

Alternatively, via Automation's Send Web Request Action:

Automation Example:

Web request URL* (required): https://<site>.atlassian.net/rest/servicedeskapi/request HTTP method* (required): POST Web request body* (required): Custom Data: { "form": { "answers": { "1": { "text": "Answer to a text form field" }, "4": { "choices": [ "123ed45a-6f7d-8c9c-bc10-c123b4567891:55" ] } }, "requestFieldValues": { "description": "I need a new *mouse* for my Mac", "summary": "Request JSD help via REST" }, "requestTypeId": "25", "serviceDeskId": "10" } Delay execution of subsequent rule actions until we've received a response for this web request: Checked Continue running the rule even if the request response is not successful (i.e. non-200 response): Unchecked Headers (optional): content-type: application/json X-ExperimentalApi: opt-in Authorization: Basic {{base64Encode('<email>:<token>')}}

Further Reading

Updated on May 1, 2025

Still need help?

The Atlassian Community is here for you.