Fetching media from Atlassian Document Format

Hi, I am trying to access files that are attached in an issue description.

In the documentation of the Attlassian Document Format’s Media Node https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/media/ it says under “Notes and recommendations” it says

  • Media id (represented as attrs.id) is immutable in Media API.
  • Consumers of the document should always fetch fresh metadata, for media with given ID, from Media API

I dont know what “Media API” reffers to or how to fetch fresh metadata.

I know that I can fetch attachments on the issue from the REST api, but I can’t find anything that connects these to the Media services ID (attrs.id) in the Media Node.

Do any of you know what I am missing?

2 Likes

I am still looking for an answer to this one, so if any of you know how to read the connection between attachments and the Media service IDs in the description it would be really helpful.

I stumpled across this: https://api-gev2.media.atlassian.com/api.html#file__fileId__image_get
Can I use this to fetch and display files from the ADF documents?
Is this api public and useable by all cloud instances?

1 Like

Any Atlassian dev who can help me here?

How do I get the attachments from an Atlassian Document Format issue description?

2 Likes

Hi @niels,

I came across this post as I was having issues with getting access to FileStore/Media API in general here.

Apparently you’d need to request for a clientId and secret from them (team-files@atlassian.com) before you can use those endpoints.

I’m still waiting for a reply from them.

1 Like

Hey @niels,

Sorry that we didn’t pick this up sooner (I came across your post when answering another question), however I think what you’re looking for is the Media API - at the moment it’s not available in the JIRA API - you might wish to create a feature request if you’d like to see it in the future

Cheers,
Mel

Not sure about others, but I’m getting 403 “you don’t have permission” when navigating to https://developer.atlassian.com/platform/media/.

Hi @mpaisley, thank you for getting back to me.

I’m still a little confused. Your documentation says:

“Consumers of the document should always fetch fresh metadata using the Media API.”

how do I do that if the Media API is not available?

As I have mentioned above, I already have access to the attachments via the REST API, I just need a way to know which attachment belongs to which Media id.

1 Like

Hi @nils,
why don’t you use the “legacy” v2 REST API and wiki markup instead of the unnecessarily complicated ADF in the v3 API?

Hey @neils,

At the moment Jira doesn’t provide an API to fetch the ID for attachments - so the best bet would be to create a Suggestion that you’d like to see an API for that in the future.

For the interim, i think using the version 2 API would be the best bet.

Cheers,
Mel