Jira Automation | Deleting attachments when clearing a custom Text Field (multi-line) containing attachments
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
While clearing the custom text field with attachments, it does not delete the attachment from the issue. This article talks about Jira automation and how it can help to delete all attachments from a particular custom text field (multi-line).
Environment
Jira Cloud.
Solution
We can add an action component to Delete attachments from the issue after the Edit Issue action in the automation rule has run.
- After the Edit Issue action, please add a For branch with the Advanced Branching with the below value to store the name of the attachment from the custom text field:
{{issue.CustomTextField.match("(\!.*?\|)").substring(1,-1)}}
- Now, we can simply use the Delete attachments action in the automation rule to delete the attachment matching the above name by choosing Matches in the drop-down value: