How can I access to the issue where was attached a file in a listener with "Attachment Created" Event?
Thank you!
Guido
Hi Guido,
Unfortunately, the Attachment Created event does not provide the Issue Key in its bindings.
The reason is that the webhook event is sent back when an attachment comes from Atlassian, and they don't provide the issue object in the event they send back.
This means you won't be able to get the issue key. You'll need to use a different event, such as Issue Updated, and check the changelog to see if the attachment field was updated, if you need the issue key.
I hope this information helps.
Regards,
Kristian
Hi
I did not find any way to get this information, The only variable available in that event are
config, logger, baseUrl, event, eventId, attachment, webhookEvent, timestamp
None of them have the issue id or key
Regards
I have found a workaround, but it is not a best practice.
I create a listener on "Comment Created" event, rather than "Attachment Created".
In this case, I must add the attachments using comments.
Then, using the variable issue, I can access to all the attachments, and I can find all the attachments created in the last 5 minutes (but is enougth in the last 60 seconds).
Hi Kristian,
I have found a workaround, but this looks better. I'll try.
It looks like you're new here. Sign in or register to get started.