Forums

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

Returning Image Attachment with Jira API

Kate Murphy
March 20, 2026

My team is currently working on an API connection for our service desk. We are facing issues regarding having an attachment image come back with the API request to be uploaded as a comment. We have tried three options (outlined below) and these have not worked for us. 

We are looking to hear from anyone who has encountered this issue with APIs and learn what your resolution was. Currently, our internal Forge team does not have a resolution to this so we are looking for ways to make this work, as the key part of the return API is having an image uploaded into the ticket as a comment. 

 

Thank you for any suggestions!

Our Ideas and Attempts:

  • Option A (Most common): Your API returns an image URL → embed that URL in the comment
  • Option B: Your API returns the image as base64 (or bytes) → you must host or attach it first
  • Option C: You want the image to be added to the comment in the API call itself (return API posts back to Jira)

2 answers

3 votes
Akash Singh
Community Champion
March 20, 2026

Hi @Kate Murphy Welcome to Atlassian Community!

To include an image in a comment using ADF, you first need to upload the image as an attachment to the work item. After the upload is complete, the next step is to retrieve the mediaId of that attachment so it can be referenced within the ADF comment node.

Currently, there is no direct API that returns the media ID. However, you can obtain it by fetching the attachment content using the following endpoint:

 

GET https://${site-url}/rest/api/3/attachment/content/${contentId}

When you perform an HTTP GET request on this URL, the response will return a redirect (via the Location header) to a Media Services URL similar to the one below:

 

https://api.media.atlassian.com/file/12345678-1234-1234-1234-123456789abc/binary?token=WHATEVER&client=WHATEVER&dl=true&name=something.jpg

The UUID value that appears after /file/ (for example, 12345678-1234-1234-1234-123456789abc) is the media ID you need.

Once you have this media ID, you can reference it in your ADF structure to embed the image in a comment.

For example:

{
"version": 1,
"type": "doc",
"content": [
{
"type": "mediaSingle",
"attrs": {
"layout": "align-start",
"width": 100.0,
},
"content": [
{
"type": "media",
"attrs": {
"id": "12345678-1234-1234-1234-123456789abc",
"type": "file",
"collection": ""
}
}
]
}
]

 

Kate Murphy
March 20, 2026

Hello @Akash Singh 

Do you have any experience or a way to relate this to Base64 decoding for this scenario? 

Thank you!

2 votes
Marc -Devoteam-
Community Champion
March 20, 2026

Hi @Kate Murphy 

What is your direct requirement you want to make a comment on a request and embed an attachment in that comment.

Is this done as a customer or as an agent (license user)?

If this is from the customer perspective, so no licensed JSM agent, https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/#api-rest-servicedeskapi-request-issueidorkey-attachment-post 

 

 

Kate Murphy
March 20, 2026

Hello @Marc -Devoteam- 

We want to decode a Base64 image to be able to be added as a comment within the Jira Issue. This image is coming as a result of an API call from a third party using a Jira automation rule.

Thank you!

Suggest an answer

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

Atlassian Community Events