Format the payload to update Assets Custom Fields via REST API
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Learn how to format the payload to update Jira Assets fields via API. Its format is differs from updating other Jira fields via REST API.
How do I format the request?
The below payload can be used with the same API endpoint to update the Asset custom field.
REST API:
curl --request PUT \
--url 'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
Payload:
{
"update": {
"customfield_XXXXX": [
{
"set": [
{
"workspaceId": "workspaceId ot the Object",
"id": "GlobalId ot the Object (workspaceId:objectId)",
"objectId": "Id of the Object"
}
]
}
]
}
}
Workspace ID
The Jira Service Management REST API uses the workspaceId
to identify your individual instance of Assets. You must include the workspaceId
to make any calls to the REST API.
Us the following endpoint to find your workspaceId
:
https://<JSM Premium Site Name>.atlassian.net/rest/servicedeskapi/assets/workspace