Automation to remove images created by incoming mail handler

Simon Galiazzo March 20, 2024

Hi all,

I have a Jira Software project (Cloud), with an incoming mail handler. This is all working fine, however I now need to adjust/edit the issue description once the issue is created. 

I know this may be better suited to a Jira Service Management project however I am trying to re-use an existing project instead of having a separate project just for the emailed issues.

Essentially what I want the automation to do is:

  • Trigger: Issue created 
  • If condition: Emailed query
  • Edit issue: Remove any image attachments

I have tried using the Delete all attachments action, however this did not work.
I have also tried using regex example listed here: Delete unwanted attachments from JSM requests using Automation | Jira | Atlassian Documentation

TLDR; Anyone have any ideas how to format my automation rule to remove images/thumbnails from a Jira Software Project task (upon creation)?

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2024

Hi @Simon Galiazzo 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

  • You note "this did not work".  What did you observe happening?
  • When using the Issue Created trigger, it can fire so quickly that some issue data may not yet be available to the rule.  This may lead to errors or unexpected results.  The work-around / fix for that is to always add the Re-fetch Issue action after the Issue Created trigger.  This will slow the rule down a bit as it reloads the issue data before proceeding with the other steps.

Kind regards,
Bill

Simon Galiazzo March 21, 2024

Hi @Bill Sheboy you were absolutely right, adding that re-fetch action helped! Thank you! The automation is now deleting the attachments from emails which is great. 
Here is a screenshot of the automation:
emailpart1.png

The only small issue is that it prompts a Jira notification email for the deleted attachments action. There doesn't seem to be a notification preference for just issue attachments either, so may need to come up with an alternative solution for removing attachments.

Simon Galiazzo March 21, 2024

@Bill Sheboy just adding to my reply, FYI I came up with a solution:

  • I added some issue actions after my first IF JQL condition, but before the branch:
    • create variable: using the issue reporter as the smart value
    • Edit issue: Change reporter to automation for Jira (and unticking send emails for this rule under 'More options'
    • Manage watchers: remove all existing watchers
  • Then the rest of the automation rule runs, deleting attachments etc. 
  • And at the end of the rule, an edit issue action: changing the assignee and reporter back to the initial creator

This allows jira to make the changes to the attachments without sending any annoying emails. Thanks again for your help! I couldn't have got it sorted without your guidance.

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2024

Awesome, and well done solving the notification issue!

Like Simon Galiazzo likes this

Suggest an answer

Log in or Sign up to answer