Ahh, well, now I have the bad news for you. That id
of that attachment needs to be looked up via the ‘Media API’, as per the ADF documentation:
Attributes
id
is the Media Services ID and is used for querying the media services API to retrieve metadata, such as, filename. Consumers of the document should always fetch fresh metadata using the Media API.
BUT… Atlassian don’t allow public access to that API, as per this thread, so you can’t get that id
.
HOWEVER… there are some workarounds, as per this thread.
This is one of those ‘catch 22’ situations with the v3 REST API and ADF where you can’t achieve the outcome described in the documentation, and where it’s better to use the v2 REST API until all the issues with v3 and ADF are sorted out.