Get Attachment of a Trigger issue

thmu January 12, 2018

Hi,

I would like to copy an attachment with the automations plugin. The attachment is in the trigger issue I wanted to get here with the filename {{# triggerIssue.attachments}} {{filename}}, {{/}}, but here I get nothing spent, although the triggerissue has an attachment. Other fields e.g. Summary are not a problem. If I do it with {{# issue.attachments}} {{filename}}, {{/}} everything works fine, but of course it's of the wrong issue.

greetings

2 answers

0 votes
Tipwanee Woradet June 19, 2020

@[deleted] 

It cannot be used. Is there a way to recommend me?

 

Screen Shot 2563-06-19 at 5.06.20 PM.pngMany thanks!

Deleted user October 23, 2020

hi @Tipwanee Woradet 
The thumbs does not load. It´s a Jira Cloud limitation. Unfortunately we can only get the file address as a comment.

0 votes
andreas
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.
January 14, 2018

Hi Thomas,

We don't support copying attachments yet unfortunately - https://codebarrel.atlassian.net/browse/AUT-162.

We've got quite a few higher priority items in our backlog at the moment so it will be a while before we can get to this, but we'll let you know when we get a chance to work on this.

If you're just after the attachment names however (and perhaps links to their content) from the trigger issue, then this should work:

{{#triggerIssue.attachment}}{{filename}} - {{content}}, {{/}}

(note that it's 'attachment', not 'attachments')

Cheers,
 Andreas

Federico Rocca January 31, 2020

Hi Andreas,

Is it possible to do it the other way round and add attachments information TO the trigger issue from its linked item?

For example, Ticket SD-1 generated XYZ-1. If I add an attachment in XYZ-1, I want this information to be reflected in SD-1.

Thanks in advance for your assistance.

Deleted user April 17, 2020

hi Andreas,

{{#triggerIssue.attachment}}{{filename}} - {{content}}, {{/}}

I´m getting an error:
Error while parsing additional fields. Not valid JSON.

Something has changed since 2018? 

Thanks

Alexey Saltykov June 1, 2020

Thank you @andreas 

I'll try

Deleted user June 1, 2020

It worked using the code below: 

{{issue.description}}
--
{{#issue.attachment}} Attachment - {{content}}, {{/}}
--
{{#issue.comments}}
Comment by: {{author.displayName}}
{{body}}
{{/}}

 It will create a block on the description like:

description of new issue
--
attatchment of original issue
--
comments of original issue
author of comments of the original issue

I hope I could help : )

Like Alexey Saltykov likes this
Alexey Saltykov June 1, 2020

Thank you, @[deleted] 

It work's fine for me!

This is what I was looking for.Attachment.png

Answer in first google page) Thx

Gonzalo Benitez de lugo October 21, 2020

Edit my comment:

I just copy-pasted the code and it worked. Many thanks!

 

Deleted user October 23, 2020

hi @Gonzalo Benitez de lugo ,

I checked my automations and it is still working fine.
Please try to discover the line that is not valid.

Nivesh Sharma October 4, 2022

i tried using the above automation but it is not working for me. I am trying to add attachment in JIRA project which should provide a link in JIRA SD ticket.

Below is the code used.

{{issue.description}}
--
{{#issue.attachment}} Attachment - {{content}}, {{/}}
--
{{#issue.comments}}
Comment by: {{author.displayName}}
{{body}}
{{/}}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events