Forums

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

Access Comment Jira API Migration to /rest/api/3/search/jql

Devon Manelski
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!
September 16, 2025
I have been able to migrate from the filter to the new /rest/api/3/search/jql API.  However, my code is now failing on getting the comment("body").  Everything else works.  There is a comment on the jira and the date of the comment is successfully retrieved.

If fields.Exists("comment") Then
If fields("comment").Exists("comments") Then
For Each oComment In fields("comment")("comments")
If CDate(mConvertISODate(oComment("updated"))) > dLatestCommentDate Then
Set oLatestComment = oComment
dLatestCommentDate = CDate(mConvertISODate(oComment("updated")))
End If
Next oComment

If Not oLatestComment Is Nothing Then
sCommentUpdated = mConvertISODate(oLatestComment("updated"))
sCommentBody = oLatestComment("body")
sCommentAuthor = oLatestComment("author")("displayName")
oWS.Cells(iInt, enuColumnNumber.Comment_Date).Value = sCommentUpdated
oWS.Cells(iInt, enuColumnNumber.Comments).Value = sCommentBody & vbCrLf & vbCrLf & " Author: " & sCommentAuthor
oWS.Cells(iInt, enuColumnNumber.Comments).Font.color = RGB(255, 255, 255)
'MsgBox (sCommentUpdated & vbCrLf & vbCrLf & " - " & sCommentBody & vbCrLf & vbCrLf & " Author: " & sCommentAuthor)
End If
End If
End If

2 answers

1 accepted

0 votes
Answer accepted
Mel Paisley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 16, 2025

Hey @Devon Manelski 

It's probably related to the fields you specified in your API call. 

Have a look at the object that's being returned as a result of your API call (you could try  something like hoppscotch to see what data is returned) and make sure you're actually getting a comment body back there. 

If not, I'd check what you've set for the fields query parameter [from API doc]

A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include:

  • *allReturns all fields.
  • *navigableReturns navigable fields.
  • idReturns only issue IDs.
  • Any issue field, prefixed with a minus to exclude.

The default isid.

Examples:

  • summary,commentReturns only the summary and comments fields only.
  • -descriptionReturns all navigable (default) fields except description.
  • *all,-commentReturns all fields except comments.

Multiplefieldsparameters can be included in a request.

Note: By default, this resource returns IDs only. This differs fromGET issuewhere the default is all fields.

If you are getting a comment body, then I'm sorry but it would indicate an issue with your code, and VBA (?) is not my forte! 

 

Hope this helps

0 votes
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2025

Hello, again, @Devon Manelski 

Sorry to be blunt, but if you are going to keep asking other people to read the API documentation for you and debug your faulty code for you, then the very least you can do is Ask A Good Question

Without all the required contextual information, you have essentially just dumped a pile of random code from some abstract language and said "There's a fault somewhere here. Find it and fix it for me.".

If you really want to be a good developer, I recommend that you Google "How do I ask a good programming question?" to learn more about this multi-decades old concept.

Devon Manelski
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!
September 16, 2025

I actually think your abrasiveness is somewhat well, I'll just leave it there.  I am not a developer.  It is not my job.  These forums are for dialogue, exchange and learning.  If you don't like a question, don't respond to it.  And I guess I should request that you don't respond to any additional posts of mine.

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 16, 2025

I'm sorry to hear that you are not able to take constructive criticism and are not willing to make the effort to learn new skills to help with your own development so that others can better assist you.

Goodbye forever, and good luck!

Suggest an answer

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

Atlassian Community Events