We have a use case where user can attach file/image in the comment section. But when we are retrieving comments for a particular issue we are not able to reference file which belongs to a particular comment and the attachments are present in other object called as attachment. the comments lies inside comment array. How can i get comments with the attached files in the comment section?
Hello @Ankush Sharma
I just try in my dev instance this API :
It retrieve all comment from an issue. When you have an attachment in a comment the API should return something like this :
body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "mediaGroup",
"content": [
{
"type": "media",
"attrs": {
"id": "039e7ec6-9e7a-42c1-b261-833430aa2aa9",
"type": "file",
"collection": "jira-10608-comment-10121"
}
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "hello "
}
]
}
]
},
Here what my comment looks like
Hope this helps
That i know already but the problem is the files i have attached when i gets the comments via rest api then the files i have uploaded, i am getting those files in attachment response and it was very confusing which file belongs to which comment and if comment section has more than one document then there is relation between the two.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The API return the comment and the file that belong to it in the body. So if you have 2 comment, you will have 2 body with their attachment and string comment.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still the name of the attached file is missing in body of comment and it is available in attachments object then how can i get which file belongs to which comment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.