Forums

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

Add Issue Comment cannot save media collection and cannot get attachment by media id

Wayne
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 1, 2023

Hi, I create my own react component to show media.

https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/media/ 

1. I cannot save the collection in add comment.

Following the media node example, I think the collection could save the file name in the node.

When I save the comment this payload creates a comment.

{
"body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "asdfasdfasdf"
}
]
},
{
"type": "mediaSingle",
"attrs": {
"layout": "align-start"
},
"content": [
{
"type": "media",
"attrs": {
"id": "real media id",
"collection": "20138",
"type": "file"
}
}
]
}
]
}
}

 the comment list will return in comments

{
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"text": null,
"content": [
{
"type": "text",
"text": "asdfasdfasdf"
}
],
"marks": null,
"attrs": null
},
{
"type": "mediaSingle",
"text": null,
"content": [
{
"type": "media",
"attrs": {
"id": "real media id",
"type": "file",
"collection": ""
}
}
],
"marks": null,
"attrs": {
"layout": "align-start"
}
}
]
}

 the collection should be 20138 but return "". 

I just want to save the attachment id in attribute, but it seems doesn't wok.

 

2. How to get media content by media id in the ADF format?

I cannot find any JIRA cloud api to get attachment by media ID.

Does any one can help me? Thank you.

 

0 answers

Suggest an answer

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

Atlassian Community Events