Jira automation to delete forms on an Issue

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

This article is about using automation to delete Forms attached to a Jira Issue 

Environment

Jira Service Management Cloud
Jira Automation Cloud

Cause

Currently, it is not natively possible to delete forms using Jira Automation and hence this article is created as a WorkAround for the following Feature Request 

JSDCLOUD-12023 - Getting issue details... STATUS


Solution

(info) We will use Rest API Calls to Get the list of Forms attached to the Issue and then Delete them.

Use the steps below to configure a built-in automation rule to automatically 


1. Create an API Key for your admin account
2. Get the List of Forms Attached to the Issue
  • Go to Project Settings > Automation > Create Rule
  • One could either configure an Automated Trigger or have a Manual Trigger; as stated in Jira automation triggers, for the purpose of this example we will use Manual Trigger.
  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    AuthorizationBasic  <Base64-ApiKey>
    X-ExperimentalAPIopt-in

    BASE64 encode the string.

        • Linux/Unix/MacOS:

          echo -n user@example.com:api_token_string | base64

  • HTTP Method: GET 
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request
  • (Optional) Add Audit Log to Capture Issue Key: {{issue}}
  • (Optional) Add comments to capture Form ID from the Web Response:  {{webResponse.body.id}}


3. Delete the Attached Forms
  • If there are multiple Forms, we need to run the Delete API against each Form ID
  • Create another variable (e.g., {{FORM}}) with the following structure:

  • Create a Branching For Each condition ; For Each {{FORM}}
  • Select "Send Web Request " under "Add an Action" 


    Headers ( Optional )

    AuthorizationBasic  <Base64-ApiKey>
    X-ExperimentalAPIopt-in

    BASE64 encode the string.

      • Linux/Unix/MacOS:

        echo -n user@example.com:api_token_string | base64

  • HTTP Method: DELETE 
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request
  • (Optional) Add a comment to capture the HTTP Response Status: {{webResponse.status}}





To get Cloud ID :

Go to : https://admin.atlassian.com/
Click on your "site" of interest and you will get the Cloud id in the URL
Resulting URL Example: https://admin.atlassian.com/s/<Your_cloud_id>users


      

Last modified on Dec 25, 2023

Was this helpful?

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