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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Need to get the attachments in the email for the assignee

I had written the below code to get attachment in the email and it is not working please let me know where is the mistake.

Hi {{issue.assignee.displayName}},

The following issue has attachment linkage:
{{issue.key}} - {{issue.summary}}

{{#issue.attachments}}
-[{{filename}}]({{URL}})
{{/issue.attachments}}

Learn more about this issue: {{issue.url}}

Regards,

Jira Automation

1 answer

0 votes
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.
Oct 20, 2023 • edited

Hi @ANJI 

What is not working as you expect?

If you are not getting a URL to the attachment file, try using the {{content}} smart value instead.  And consider that only recipients with a Jira user will be able to access that URL.

If you are expecting an image of the attachment file to appear in the email, that is not possible at this time with outgoing emails.

And for your iterator, I suggest simplifying to avoid having errors in your message.  For example:

{{#issue.attachments}}
-[{{filename}}]({{content}})
{{/}}

Kind regards,
Bill

Hi Bill,

 

I need the attachments in the email for the assignee of the defects. 

I had tried with the above one but unable to get it Can you please check and let us know if there is code to get the attachments in the email.

 

Thanks

Anjireddy 

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.
Oct 23, 2023

I do not believe that is possible. The rule actions for emails do not send the attachment, and while there is a REST API function to get an attachment, but that cannot be used to send it in the rule's email action.

Hi Bill,

 

Can you provide the code which we can get the URL of the attachment in the email.

URL is also fine for us please let us know.

 

Thanks

Anjireddy

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.
Oct 26, 2023

Please see my first post in this thread, as it shows the {{content}} attribute of attachments, which provides a URL a licensed Jira user can access.

@Hi @Bill Sheboy 

 

I had tried with the above code which you had provided but not received any content or the URL please let me know how to write this.

 

Thanks

Anjireddy

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.
Oct 27, 2023

Please post an image of your complete rule (in one image), images of each action / condition / branch, and an image of the audit log details showing the rule execution.  Those may provide context to explain what is happening.

Again regarding my first post: I tried that and it provided a URL which may be used to trigger a download, when used in an email.

Hi Bill,

 

Please find the attached logs and content.Script logs.JPGScript content.JPG

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.
Oct 27, 2023

The audit log shows the cause of the symptom: 

Your trigger is using JQL, and you have selected the option to not include issues which have not changed since the last run execution.  And so there are no issues to process.

I recommend considering what you want to do: leave the rule as-is, or remove that option from the trigger.

And...The conditions in your rule could be removed and added to the trigger JQL with this:

AND assignee IS NOT EMPTY AND attachments IS NOT EMPTY

Hi @Bill Sheboy

 

Thanks for the update it worked and we got the links in the email but we are unable to open that links getting the below error.

 

error.JPG

Thanks

Anjireddy

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.
Nov 01, 2023

Only people with Jira access (and access to the specific issues) will be able to view those attachments using the link.

Hi Bill,

 

I had the access to the Jira and for the issue as well.

 

Thanks

Anjireddy

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.
Nov 01, 2023

I just re-tested this for an issue that I have access to, and was correctly prompted to download the attachment.

If you go to the specific Jira issue for that attachment:

  • can you view the issue
  • can you download the attachment for the issue

 

If you can, I suggest working with your Jira site admin to submit a ticket to Atlassian Support here: https://support.atlassian.com/contact/#/  They may see something in their internal logging to explain this permissions issue.  

When you hear back from them, please post what you learn to benefit the community.

Suggest an answer

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

Atlassian Community Events