Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get newly added attachment in Jira automation

nik_shivamprajapati February 27, 2022

How to get the newly added attachment through smart values.

1 answer

0 votes
Sachin Dhamale
Community Champion
February 27, 2022

@nik_shivamprajapati ,

 

Can you please elaborate what is the use case? Why do you want to get attachment?

Do you want to get the name/URL of attachment or download the attachment

nik_shivamprajapati February 27, 2022

I've added an automation for issue updated event for attachments.

I've tried using:

[{{#attachment}}{"attachment_link":"{{content}}","name":"{{filename}}"}{{^last}},{{/}}{{/}}]

but it gives all the attachments of an issue.

I only want to get the url and filename of the last/recently added attachment.

Sachin Dhamale
Community Champion
February 27, 2022

@nik_shivamprajapati 

can you try this

{{attachment.filetype.last}}

nik_shivamprajapati February 28, 2022

I had tried, but this is not giving the correct results each time.

David Yohler June 14, 2023

It is a little tricky but a saw a similar thread and was able to do something like this.

Trigger on Attachment -> Value added

Then you need a smart branch on {{issue.attachment}}

Then check if {{attachment.filename}} equals {{addedfieldChange.values}}

Then the attachment you want (i.e, the one just added) is in focus

Like Zachary Hayes likes this

Suggest an answer

Log in or Sign up to answer