Hi,
Just as in this topic [Automation for Jira] Get last added attachment to... (atlassian.com) I want to access the last attachment added to the issue in order to send its content to another webservice.
My current automation has a trigger of "attachment added", then I capture the attachment.last.content and send it with the "web request" action.
Unfortunately, it seems like the "attachments" array of the issue is not ordered by "creation date" but alphabetically.
How to capture the last attachment added to the issue? this is very troublesome.
Is their a solution without a scriptrunner or any marketplace app
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sidharth verma it's tricky but you need to get the larger attachement ID from the list, because the attachement ID is incremental. Then somehow reconstruct the content URL leading to this attachement. Note that if two attachments are added mostly at the same time, this might not work…
Another "solution" is to use the "webhook" feature from Jira. Triggered on the "attachement created" event. This webhook can then be connected to a Jira automation with the "incoming webhook" trigger. All details regarding the attachment are within the request's body.
Two major dark points regarding this technique is that you kind of need to make an external request (that's not a localhost request) AND the worst one, those webhook do not require any sort of identification so a malicious person could technically send a mockup request to this "incoming webook" Atlassian generated URL.
But it works :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.