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
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:
*all
Returns all fields.*navigable
Returns navigable fields.id
Returns only issue IDs.- Any issue field, prefixed with a minus to exclude.
The default is
id
.Examples:
summary,comment
Returns only the summary and comments fields only.-description
Returns all navigable (default) fields except description.*all,-comment
Returns all fields except comments.Multiple
fields
parameters 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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.