Hi,
I am using the jira rest api and when y query some issue i can get the description and if an imager were embedded in the description the API returns me something like this:
(
[type] => mediaSingle
[attrs] => stdClass Object
(
[layout] => center
)
[content] => Array
(
[0] => stdClass Object
(
[type] => media
[attrs] => stdClass Object
(
[id] => 52fa9b66-4880-...-8840ae2ff490
[type] => file
[collection] => jira-918-field-description
[width] => 200
[height] => 183
)
)
)
)
How could i get the image attached there?
I have tried call the endpoint: GET /rest/api/3/attachment/{id}
But does not accept me the id I get this error:
{"errorMessages":["El archivo adjunto con id '52fa9b66-...-8840ae2ff490' no existe"],"errors":{}}
In the issue response has the node attachment within it i can find the id corresponding with the attachments but I don't know hwo to link each attachment (image) to the enbedded images.
The attachment object looks like this:
[attachment] => Array
(
[0] => stdClass Object
(
[self] => https://api.atlassian.com/ex/jira/.../rest/api/3/attachment/....
[id] => ....
[filename] => 01.1.1 Login-touchID-activar.jpg
[author] => stdClass Object
(
...
)
[created] => 2019-05-24T10:50:23.914-0500
[size] => 113023
[mimeType] => image/jpeg
[content] => https://....atlassian.net/secure/attachment/..../01.1.1+Login-touchID-activar.jpg
[thumbnail] => https://....atlassian.net/secure/thumbnail/..../01.1.1+Login-touchID-activar.jpg
)
....
)
If I query the attachment id on the /rest/api/3/attachment/{id} endpoint i can get the image information and the file content but i can not link it with the embedded one in the issue description.
Is there any way to achive this?
Thanks.
I found a solution. For me it was related to using api/2 vs api/3. Using api/2 you can send a string that equivalent to what you put in in "edit" of description field text.
Some additional notes here:
Did a solution ever come up for this?
I am battling same thing!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unlock your potential and learn how to use Jira Product Discovery to your advantage. You’ll have the expertise to revolutionize ideas and insights, roadmapping, engage and align teams and stakeholders, and deliver the best solutions—faster. Enroll today!
Start Learning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.