If I iterate over the values and filter on objects containing "comment" I can parse the following info.
comment_obj_keys = [id, createdDate, user, action, commentAction, comment]
comment_obj_keys.getClass() = class java.util.LinkedHashSet
if comment_obj_keys.contains("comment")
id = 185562
createDate = null
user = [REMOVED]
action = COMMENTED
commentAction = ADDED
comment = [ properties:[repositoryId:1794],
id:16564, version:0,
text:Meaninful results of Jenkins build,
author:[REMOVED],
createdDate:1659127730708,
updatedDate:1659127730708,
comments:[],
tasks:[],
severity:NORMAL,
state:OPEN,
permittedOperations:[editable:true, transitionable:true, deletable:true]]
According to everything I've read. I should be able to use the id=166564 to access the comment with the goal of ultimately deleting it. If I put the url in my brower I can see the comment.
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/16564
{"properties":{"repositoryId":1794},
"id":16564,
"version":0,
"text":"Meaninful results of Jenkins build",
"author":REMOVED,
"createdDate":1659071192164,
"updatedDate":1659071192164,
"comments":[],
"tasks":[],
"severity":"NORMAL",
"state":"OPEN",
"permittedOperations":{"editable":false,
"transitionable":true,
"deletable":false}}FYI I'm making (and trying to delete) the comment from Jenkins with the same bitbucket token. And I'm going to the link for the above results
However, when I try to delete the comment (projectKey, repositorySlug, and pullRequestId are replaced with the actual values):
{"errors":[{"context":null,"message":"You are attempting to modify a comment based on out-of-date information.", "exceptionName":"com.atlassian.bitbucket.comment.CommentOutOfDateException","currentVersion":0,"expectedVersion":-1}]}
adding: comments/16564?0 yields the same result
adding: comments/16564?-1 yields the same result
adding: comments/16564/?-1 yields the same result
Any ideas what the issue might be?
Thanks!