Jira service management automation rule to delete assets objects using REST API command


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

Summary

Currently, there is no action in Jira cloud to delete assets objects via automation. The only available actions are to create and edit objects. We have an open feature request to address this requirement.

JSDCLOUD-11218 - Getting issue details... STATUS

 This article explains how you can create an automation rule to add action to send a REST API to delete the object/s as mentioned in the workaround section of the feature request.

Environment

Jira service management cloud

Solution

Here I am sharing the steps for creating the automation rule.

  • Go to Global automation in your instance.
  • Click on create rule. You can choose the trigger based on your requirements. Here, I have selected the scheduled trigger.
  • Create an AQL branch select the assets schema and update the AQL query to suit your match.
    • Ex: "Account Enabled" = False
  • You can put a log action to print the deleting object ID. (optional)
  • Add a "Send web request" action to invoke the delete assets object REST API command.
  • Ex:
    • Web request URL: https://api.atlassian.com/jsm/assets/workspace/1234455-0e3d-4506-98df-729ab0bed9d0/v1/object/{{object.id}}
    • HTTP method: DELETE
    •  Headers:
      • Key: Authorization
      • Value: Base64 encrypted API token of your Atlassian account ID
  • You need to pass the correct workspace ID of your instance. You can get the workspace ID using this REST API command.



Last modified on Jan 31, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.