Forums

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

Attachments macro exclude filename patterns

Joe Miller September 18, 2018

How do I filter files in an attachment macro to only show files with a certain file name, such as "status"?  Also exclude those same files in another macro.

1 answer

0 votes
Shawn C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2018

Hi Joe, 

The Attachments Macro does have a way to filter to specific File names based on a Regex Expression added to the macro.  I'm not the best regex'er, but you should be able to use something similar to:

  • Show only "Status" Attachments:
    .*[Ss][Tt][Aa][Tt][Uu][Ss].*
  • Show everything other than "Status":
    ^((?!.*[Ss][Tt][Aa][Tt][Uu][Ss].*).)*$

Bracketed Letters are used to catch any Camelcase that may be in the filenames and it's wildcarded out so that it's looking for "status" anywhere in the name. 

You might also consider using some Labels on your Attachments as the Attachments Macro does filter on Multiple Labels using an AND.  This means you could have macros that display "Status Active" or "Status Inactive" and just update the labels on the Attachments when they're Active/Inactive.

Cheers, 

Shawn

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events