Forums

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

accessing attachment in JSM datacentre container environment

Mohamed Saad Taha
Contributor
October 29, 2025

Dears,

 

I want to send Jira requests attachment as base64 format to external system I already have scriptrunner is there any hope to be able to send attachment to External API through listener or automation or any other way 

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
November 10, 2025

Hi @Mohamed Saad Taha 

Yes, you can achieve that with a listener.

I hope it helps

// first get the attachment from the event object
def attachment = event.attachment
def attachmentFile = attachment.getFile()

// then base64 decode the file
def bytes = attachmentFile.bytes
def base64 = Base64.encoder.encodeToString(bytes)

// set your body with key, filename and the decoded
def body = [
issueKey : attachment.issue.key,
filename : attachment.filename,
data : base64
]

def response = post("https://your.external.endpoint/")
.header("Content-Type", "application/json")
.body(JsonOutput.toJson(body))
.asString()


 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
10.4.1
TAGS
AUG Leaders

Atlassian Community Events