Forums

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

Jira Automation - Regex Not Working for Deleting Attachments

adam.carter
Contributor
June 2, 2023

Hi there,

Hope somebody can help as I am struggling to get an automation to work. It's not a particularly tricky one; when an issue transitions to done, if a certain field is not empty, delete all attachments that start with the string "Data Privacy".

JiraAutomation.PNG

Automation triggers fine, if condition matches but the attachments are not deleted.

I've tried variations of the regex as I am not a regex master by any stretch but online tools suggest they would all work:

  • "^Data Privacy*"
  • "Data Privacy*"
  • Data Privacy*
  • Data*

I've output the names of the attachments in a comment using another Jira automation to try and prove that the automation is seeing the filenames as I see them:
JiraComment.PNG

I've set the rule to delete all attachments instead and that did work.

Here's the audit log of the last run:
JiraAuditLog.PNG

Any, and all, help greatly appreciated.

Many thanks

1 answer

0 votes
Andy Heinzer
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 Champions.
July 10, 2018

What about disabling the login gadget on the dashboard instead?   It does not directly address your request to customize the text there, but if you remove it by following the steps in the KB https://confluence.atlassian.com/jirakb/howto-hide-the-login-gadget-from-the-system-dashboard-in-jira-5-1-305037906.html

In my Jira 7 version, I only had to follow these steps:

Creating or Editing jira-config.properties
  1. Navigate to <jira-home>
  2. Check for the presence of a jira-config.properties file
    1. If it exists, back it up now.
    2. If not, create a new, blank text file with that name.
  3. Add this line to the end of the file:

     jira.disable.login.gadget=true
  4. Save the file
  5. Restart JIRA to commit changes

This would remove the login gadget from that dashboard for all users.  

The only problem I see with this is in regards to your other users that are used to logging in this way might be inconvenienced to have to click the Log In button in the top right corner of the screen in order to proceed to login to Jira.   So it is another click for your users to follow, but I think this might be a viable option for you to consider in this case.

Suggest an answer

Log in or Sign up to answer