Comment URL link to most recently uploaded attachment

Ryan O'Donnell March 5, 2021

Use case: Historically we've been able to copy the URL to an attachment and paste that URL in a URL field. In the new Jira UI you can no longer (easily) copy the URL of the attachment

Potential workaround: Jira Automation Rule, triggered by a change to Attachment which will comment the URL to the most recent attachment. Ideally we would like the URL to the attachment directly to  Custom Field, but would be okay with the URL link being commented and copied from the comments as well.

I'm having trouble writing a rule to return the URL of the most recent attachment closest I've gotten is {{#issue.attachment.last}} "{{content}}">{{filename}}</a></li>{{#issue.attachment.last}} but last. does not seem to return the most recently uploaded attachment 

Any other thoughts would be much appreciated. Thank you!

2 answers

1 vote
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2021

Hi @Ryan O'Donnell 

The ability to sort/filter/mutate a list in smart values is something that is currently lacking in Automation for Jira. We are tracking this problem in issues such as https://codebarrel.atlassian.net/browse/AUT-1241, but at this time, sorting as list by chronological order is not something that is possible. Automation for Jira gets back the list of attachments from the Jira API, which is not guaranteed in its ordering. What you have already done is as close as possible to the solution that is currently available.

Cheers

Sam

0 votes
Matthew Patton December 14, 2021

@Ryan O'Donnell  @Sam Harding 

I have a workaround for this problem using a combination of wiki markup and smart values. You can use your Base URL or [^attachment.ext] . Works for the description field, so I imagine a comments or any field using wiki render will work just fine. 

 

Trigger: when value changes for Attachment

Edit Issue fields

[<baseURL>/attachment/{{fieldChange.to}}/{{fieldChange.toString}}]

OR

[^{{fieldChange.toString}}]

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events