Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I get attachment names from multiple issues with smart values

David Meadow October 26, 2021

I have an automation rule that works across all the issues linked to an epic. We are sending issue details to an external process via webhook. Using {{#issues}}{{key}}, {{/}} in the body of the web request I get a comma separated list of all the keys. If I run {{attachment.filename}} against ONE issue (different rule to test the smart value) I get a comma separated list of the attachments for that issue. What I would really like is a list of all the issue keys linked to the epic, and all the attachments associated with those issues. They don't even have to be associated pairs, I just need the values. I tried variations of:

{#issues}}{{key}}{{attachment.filename}}, {{/}}

{#issues}}{{key}}, {{attachment.filename}}, {{/}}

{#issues}}{{key}} {{#attachments}}{{filename}}, {{/}}

{#issues}}{{key}} {{/}}, {{#attachments}}{{filename}}, {{/}}

...

and to attempt just the file names:

{{attachment.filename}}

{#attachments}}{{filename}}, {{/}}

etc.

the best I got was a list of issue keys followed by a string of commas and spaces. 

 

 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
David Meadow October 27, 2021

I found the answer -- {{#issues}}{{key}}_{{attachment.filename}} {{/}} produces string:

XXX-001_FileName1, FileName2, FileName3 XXX-02_FileNameX, ..., ...

Charlene Stober June 9, 2023

Hi David - could you please show me the screen shots for this rule?  I've tried to implement it, and am failing miserably.  ;-(

Thanks,

Charlene

David Meadow June 9, 2023

The text I put in the answer is exactly what I am using.

{{#issues}} tells Jira to cycle through all issues that match the rule filter. each {{xxx}} thereafter is part of the string. Anything between }} and {{ is treated as text. {{/}} ends the string telling Jira to move to the next instance. 

{{#issues}}{{key}}_{{attachment.filename}}, {{/}}

 

What happens when you run the rule? Can you upload a screenshot of your rule? 

Charlene Stober June 12, 2023

Hi David - thanks for the speedy reply! Below is a pic of the rule. I haven't spent a lot of time on email content other than trying to get attachment names for all issues. The rule is generating an email for issues resolved within the past 7 days, displaying attachment name along with the key.

Attachment Rule.png

Running the rule run was a success it shows:

run auto rule.png

Email received includes no content.

Auto Rule no content.png

David Meadow June 12, 2023

I am not sure why this is happening, your rule looks correct, assuming of course the issues your query found have attachments. If they don't you will get APS-2437_, APS-2438_, APS-2439_, ...  I'm using data center so I checked the Cloud documentation and {{attachment.filename}} is the correct tag. 

 

I just rigged up a test with a manual and scheduled trigger and got a good list. There are a couple of options on the schedule trigger that may have an effect. Screen shots of the rule segments and results are attached.batch options.jpg

 

email values.jpg

 

 

email results.jpg

Charlene Stober June 13, 2023

Hi David - the issues do indeed have attachments.  I'll review further.  Thanks again for taking a look.

Charlene

TAGS
AUG Leaders

Atlassian Community Events