Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Acces {{issue...}} smart value inside a list

Hi All,

I recently created a JIRA automation rule that send a email when een registration of software is done successful for a customer.
This is working fine for 99% the only problem is with the link to attachments.

i use the following way to add a list of attachments
<a href="{{content}}">Attachment: {{filename}}</a>

This is working fine for our employees that have a JIRA license. but the link generated from {{content}} is not accessible for our customer that have only a JIRA Customer account.

 the link that is generated is 

https://*JIRA URL*/secure/attachment/*AttachmentId*/*AttachmentFilename*

When i login the to the customer portal the url that the customer see from there is as followed

https://*JIRA URL*/servicedesk/customershim/secure/attachment/*AttachmentId*/*AttachmentId*_*AttachmentFilename*?fromIssue=*issueid*}}

So i thought i wood created the URL for the email my self.

<a href= "*JIRA ULR*/servicedesk/customershim/secure/attachment/{{id}}/{{id}}_{{filename}}?fromIssue={{}}">Attachment: {{filename}}</a>

But the problem is that the smart value ((}} is not giving the value back i think it is because it is inside the smart value list. when i use the {{}} outside the list it is working.

How do i use the {{}} in the smart value list


2 answers

1 accepted

2 votes
Answer accepted

Oke i fixed it by making a Scriptrunner field for it.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def baseurl = com.atlassian.jira.component.ComponentAccessor.getApplicationProperties().getString("jira.baseurl")

def issues = [issue] as List<Issue>
issues.addAll(issueLinkManager.getOutwardLinks( {it.destinationObject})
issues.addAll(issueLinkManager.getInwardLinks( {it.sourceObject})

issues.collect { issue ->
issue.getAttachments().collect { att ->
"<a href=\""+ baseurl+ "/servicedesk/customershim/secure/attachment/" + + "/" + + "_" + att.filename + "?fromIssue=" + + "\">" + att.filename + "</a>" + "<br/>"


That field i used to show me the links in the send email.
the only down side is that i show all attachments from the issue even when te customer does not have the proper rights for it.

0 votes

Hi @Cow Hills 

This is inside of the iterator processing for {{#issue.attachment}} so have you tried just {{id}} by itself?

Best regards,


Darryl Lee Community Leader Mar 10, 2021

My read on this was that {{id}} is returning the id of the Attachment, and they're hoping to refer back to the Issue id.

Would a (gulp) variable work?

{{origid}} = {{}}

And then try using {{origid}} in the list iteration?

Hi @Bill Sheboy , 

thanks for you answer {{id}} wil give back the attachment id but i need the id for the issue it self.

Hi @Darryl Lee ,

Thank you for the suggestion.
I have tried the following

{{origid}} = {{}}

<a href= "https://*JIRAURL*/servicedesk/customershim/secure/attachment/{{id}}/{{id}}_{{filename}}?fromIssue={{origid}}">Attachment: {{filename}}</a>


but still nothing.
i not even sure that the {{origid}} variable is working i am also unable to find anything about it in the documentation for JIRA Automation Server.

Darryl Lee Community Leader Mar 10, 2021

@Cow Hills does the link work without ?fromIssue=*issueid*?

Like in an incognito session, does this work:

https://*JIRA URL*/servicedesk/customershim/secure/attachment/*AttachmentId*/*AttachmentId*_*AttachmentFilename*

Because I wonder if the fromIssue part might be optional.

Darryl Lee Community Leader Mar 10, 2021

Sorry, when I wrote {{orgid}} = {{}} I was suggesting that you use the Create variable action to set the value. Example:


@Darryl Lee 

No without the ?fromissue=*issueid* it is not working it will get a HTTP Status 400 – Bad Request

For the Create Variable function there is not support for the Server version and that is the one we use not the cloud version of JIRA.

Darryl Lee Community Leader Mar 10, 2021

Ahh, thanks for clarifying. I was just looking at my Cloud instance and did not see that attachment format at all. (You tagged this question as cloud, so that's why I was working from that assumption.)

I've unfortunately not had the opportunity to work with Automation on Server.

Reading this bug, I wonder if a possible workaround might be to add a comment with the attachment referenced thusly:


Hi @Cow Hills 

Now that we know you are using Jira Server, I would like to suggest a pause and ask you to post an image of your entire automation rule.  That may provide more context for the community to offer ideas.


Hi @Bill Sheboy 

please see the following printscreen of the send email part of the automation rule.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events