Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to remove images created by incoming mail handler

Simon Galiazzo March 20, 2024 edited

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 edited

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
Michael Woolfall
Contributor
April 9, 2025

@Simon Galiazzo Can you please re-upload your screenshot of the Automation a bit bigger because I can't make out some of it?

I'm thinking about implementing this because when I investigated the issue of the images in an email signature creating multiple attachments against the JIRA ticket, I discovered the following:

  1. This was an issue many agencies were complaining about.
  2. Atlassian came up with a "Fix", but the Fix only got half-way there ie. it sounds like it made it so that each unique image was only attached ONCE, rather than multiple times.
  3. There's a Paid App that sounds like it can resolve the issue but it's quite expensive so is not an option for us: Enterprise Mail Handler for Jira (JEMH).
  4. Hopefully it's still on Atlassian's radar to come up with a free solution to this but I'm not so sure it is. Very annoying when a solution only gets half-way there and then the bigger issue is ignored as a result.

The negative part of this particular solution using Automation is that, if my understanding is correct, it will remove ALL images from the ticket which could potentially include valid images such as screenshots the requestor has taken to help illustrate their point and popped in the email body. Sounds like the only way around that currently is using the JEMH Paid App which sounds like you can upload commonly used images to and it then recognises those same images in emails and excludes ONLY those images.

Simon Galiazzo April 9, 2025

@Michael Woolfall apologies not sure what happened with my original screenshot.

I agree it's disappointing that there isn't an in-built solution from Atlassian that answers this requirement.

I ended up splitting it into multiple automation rules, to try and mitigate the possibility of wanted image attachments being removed, i.e:

rules.png

So for the create/update rule, I had the following:

create pt1.png create pt2.png create pt3.png

The branching component essentially checks if the attached image has the [image#.] as the file name, since signature image attachments seem to have this naming convention (at least in my experience). So if your attachments have a different name they should be fine? However you will need to test.
And the final edit issue component rewrites the issue description, without the attachments/filenames.

Hope this helps?

comments.png update.png

Simon Galiazzo April 9, 2025

@Michael Woolfall zoomed in on the smart value conditions from the 3 rules I setup, see attached:

updates detail.png comments detail.png create replace description.png

Michael Woolfall
Contributor
April 9, 2025

Awesome, thanks @Simon Galiazzo
I'll check it all out and get back to you if I have any further questions :)

Like • Simon Galiazzo likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events