Forums

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

API / attachment question in automation

alasdairpa April 4, 2025

 

Hi all, looking for some advice regarding attachments to tickets and APIs.

Using automation I'm trying to do a web request call that will send an attachment to an external system using their API where there is and attachment on the JSM ticket. I cant work out what the custom data web request body should look like. i.e. the json syntax

When I add a log using {{issue.attachment}} I get a lot of data returned (example below), and not sure what to use to reference the attached file.

SmartAttachmentBean{source=AttachmentBean{self='https://mocloud.atlassian.net/rest/api/2/attachment/484764', id=484764, filename='Screenshot 2024-10-22 125805.png', author=UserBean{name='null', key='null', accountId='***', emailAddress='**@**', displayName='******', active=true, timeZone='Europe/London', locale='null'}, created=Fri Mar 28 16:39:25 GMT 2025, size=20979, mimeType='image/png', content='https://mocloud.atlassian.net/rest/api/2/attachment/content/484764'}} AttachmentBean{self='https://mocloud.atlassian.net/rest/api/2/attachment/484764', id=484764, filename='Screenshot 2024-10-22 125805.png', author=UserBean{name='null', key='null', accountId='****', emailAddress='**@**', displayName='**', active=true, timeZone='Europe/London', locale='null'}, created=Fri Mar 28 16:39:25 GMT 2025, size=20979, mimeType='image/png', content='https://mocloud.atlassian.net/rest/api/2/attachment/content/484764'}

 

Although the 3rd party gave me a postman example of the headers and endpoint etc in postman you can browse to the file you want to send, however I don't know how to do that from JSM when the attachment is on a ticket.

 

See below one of my attempts, clearly not correct though. Any advice greatly appreciated. :)

Screenshot 2025-04-04 090911.png

1 answer

0 votes
Manon Soubies-Camy
Community Champion
April 4, 2025

Hi @alasdairpa,

Can you try a Log action with {{issue.attachment.filename}} to check you’re pulling the correct value from the ticket?

Filename: {{issue.attachment.filename}}

That will confirm if the smart value is returning what you expect.

automation-filename.png

Also, just a quick heads-up: this is a public forum, so you might want to remove personal info like your email address, account ID, and site URL from your message.

Hope this helps!

- Manon

Suggest an answer

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

Atlassian Community Events