Can I use Smart Values to pass attachment links from blocker to blocked issues?

Jon March 11, 2021

Is there any SmartValue out there or any other way to generate a list of links to an issue's attachments?

Situation

We have a project that has two types of issues: Data Acquisition and Tasks.

Data is collected in Data Acquisition issues then the blocked Tasks use this data (many to many relationship between Data Acquisitions and Tasks).

Automation adds a comment to Tasks when Data Acquisition issues are completed to alert assignees.

Problem

Task assignees do not have any direct path to the Data Acquisition data they need while viewing the Task. Requiring users to click through linked issues to access the data is a drain on time as is requiring users to manually propagate Data Acquisition attachments out to blocked issues.

How can we automatically have attachments from Data Acquisition issues available on Tasks with a single click?

What I've tried

I have not found any workflow automation, project automation or legacy automation that will copy attachments from one issue to another.

I'm currently trying to make it happen with SmartValues but do not see one that returns the path of the attachments, only the file name. I am missing the attachment ID.

Screenshot_2021-03-11 Project automation - Jira(1).png

1 answer

1 accepted

5 votes
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 11, 2021

Hi @Jon 

At this time for automation rules, I believe you can only add links to the attachments in the linked story comment.  Selecting such a link will download it as a copy, and will not open within Jira.

If that would work for you, this will produce a list of links to the attachments for the triggering issue:

Here is the list of attachments in {{triggerIssue.key}}

{{#triggerIssue.attachment}}
* {{filename}}: {{content}}
{{/}}

 

Best regards,

Bill

Jon March 11, 2021

That did it! Thank you so much!

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 12, 2021

Jon, I am glad that helped you.

By the way, when hunting around for a smart value for a field you may use the method described in this article to help.  It involves finding a representative issue/story and then calling the REST API for it; the resulting JSON will often show the smart value name.

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

__Bill

Hanna Torany January 27, 2022
Here is the list of attachments in {{triggerIssue.key}}

{{#triggerIssue.attachment}}
* {{filename}}: {{content}}
{{/}}

IT give me the list of all attachment. How can i get the last attachment i added? 

Like # people like this
Naresh G November 18, 2022

@Bill Sheboy 

We have a Jira service management issue linked to the Jira software project issue. one of our users adds a comment on the Jira software issue with file & image. we are using an automation rule to copy the comment from the software project to the service management project issue. we are able to copy the comment content. But the file appears as "failed to load" on the service management issue

we are using the following smart value in the action of automation rule.

{{triggerIssue.comment.last.body}}

Could you please help me with this? Thanks!!

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.
November 18, 2022

Hi @Naresh Gantala 

If you are on a paid license for Jira and Jira Service Management, I recommend working with your site admin to submit a support ticket for this symptom here: https://support.atlassian.com/contact/#/

There appear to be several open defects related to accessing attachments via comment links from JSM, and support can help identify what is happening.  Here are some of those defects if you want to take a look for comparison:

Kind regards,
Bill

Like Naresh G likes this
Naresh G November 18, 2022

Thanks Bill Sheboy

Rick Crow
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 23, 2023

@Bill Sheboy : Disregard, I found a solution right after I posted this ... sorry for the false alarm!

Hi, Bill! I found this post and am using your suggested approach here for listing issue attachments in a custom email. It works fine, but at least in my testing using the Outlook web client, the URLs don't show up as links, which will be important in my use case. 

I've tried wrapping the {{content}} tag in html to force the link, but that's failing as I suspect it's not considered valid .json ... any thoughts?

ZC January 11, 2024

@Rick Crow  plz share the solution as URLs still don't appear as links on Outlook web client. they work fine on Outlook Android app though.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events