Trying to create a custom cql function (using ScriptRunner) to return all unresolved comments, but everything with inline comments (be they unresolved or not) is showing up.
Any ideas?
import com.atlassian.confluence.pages.Page
import com.atlassian.confluence.pages.PageManager
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.spaces.Space
import com.atlassian.confluence.spaces.SpaceManager
import com.atlassian.confluence.pages.Comment
import com.atlassian.confluence.pages.CommentManager
String spaceKey = params[0]
def ids = []
def spaceManager = ComponentLocator.getComponent(SpaceManager)
def pageManager = ComponentLocator.getComponent(PageManager)
def commentManager = ComponentLocator.getComponent(CommentManager)
Space space = spaceManager.getSpace(spaceKey)
for (Page page : pageManager.getPages(space, true)) {
List<Comment> allComments = commentManager.getPageComments(page.getId(), new Date(0))
for (Comment comment in allComments) {
if (comment.isInlineComment() && !comment.getStatus().isResolved()) {
ids << String.valueOf(page.getId())
}
}
}
return ids