Forums

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

Any recent change in attachment content response API

Aswanth Seetharaman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 14, 2023

Has there been any recent change in response of attachment field in API of fetching issue type?

API: <<base_instance_url>>/rest/api/2/issue/<<issue_id>>

In response of this API, we were getting content attribute inside attachment in different format, this causes some backward compatibility issue in our application.

This is the body section of the attachment a few days before:

"body": "<p>add comment with attachment <span class=\"image-wrap\" style=\"\"><a id=\"10000_thumb\" href=\"http://clm-aus-udmb33.bmc.com:8080/secure/attachment/10000/10000_Screenshot+2023-06-14+115307.png\" title=\"Screenshot 2023-06-14 115307.png\" file-preview-type=\"image\" file-preview-id=\"10000\" file-preview-title=\"Screenshot 2023-06-14 115307.png\"><img src=\"http://clm-aus-udmb33.bmc.com:8080/secure/thumbnail/10000/_thumb_10000.png\" style=\"border: 0px solid black\" /></a></span></p>",

 

This is now in Cloud Jira:

"body": "<p>Adding a comment with attachment </p>\n\n<p><span class=\"nobr\"><a href=\"/rest/api/3/attachment/content/10012\" title=\"CorrectRLS.sql attached to MCBP9-6\" data-attachment-type=\"file\" data-attachment-name=\"CorrectRLS.sql\" data-media-services-type=\"file\" data-media-services-id=\"78709b2a-bf25-4a92-8f3d-819283929a0d\" rel=\"noreferrer\">CorrectRLS.sql<sup><img class=\"rendericon\" src=\"/images/icons/link_attachment_7.gif\" height=\"7\" width=\"7\" align=\"absmiddle\" alt=\"\" border=\"0\"/></sup></a></span></p>\n",

 

Can you please confirm that is this a recent change in API response of getting attachment content for Jira cloud?

1 answer

0 votes
Jehan Bhathena
Community Champion
July 13, 2023

Hi @Aswanth Seetharaman ,

I'm not sure of the old API calls, but I use the below method to fetch the Issue's attachments:

  1. Use the GET ISSUE api : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get, and fetch the "Content ID" of the attachments present in the ticket
  2. Then pass that "content ID" in this API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-attachment-content-id-get, to download the attachment

Do let me know if this helps.

Suggest an answer

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

Atlassian Community Events