Hi Everyone,
I've been working on a project where I want to fetch the latest comment(if any) from Jira issue and update it in our tool. Now, when I am using the below endpoint, I am getting all comments which are unnecessary for me.
https://jira.dev.corp.adobe.com/rest/api/2/search?jql=issue=AMSAUTO-10517&fields=comment
Response -
"key": "AMSAUTO-10517",
"fields": {
"comment": {
"comments": [
{
"self": "https://jira.dev.corp.adobe.com/rest/api/2/issue/5187946/comment/16530402",
"id": "16530402",
One observation - I could see that I can get the comment by using "fields=comment" in the jql search, so, is there any way to grab the comments under comment?
Please look into it and help me with this.
Regards,
Snehangshu Sarkar
Hello,
You need to go through all comments in the comments array ("comments": [.....]) and find the latest one.
Hi Alexey,
Thanks for the update.
Is there any way to get the latest comment only via REST API or grab the comments under comment in endpoint? Because If I am able to grab the comments, then I can use StartAt=maxResults to get only the latest one.
Regards,
Snehangshu Sarkar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no special rest api for getting the latest comment. You need to iterate over all comments and find the latest one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can order the result from the latest and ask to return the first
something like
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.