Question, because I'm stuck... The log shows the <value> I am searching for but the comment does not delete--
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.security.roles.ProjectRoleManager
import com.atlassian.jira.security.roles.ProjectRole
import org.apache.log4j.Logger
def log = Logger.getLogger("com.acme.workflows")
IssueManager issueManager = ComponentAccessor.issueManager
CommentManager commentManager = ComponentAccessor.commentManager
def issueKeys = [<value1>,<value2>]
issueKeys.each
{issueKey ->
MutableIssue issue = issueManager.getIssueObject(issueKey)
List<Comment> comments = commentManager.getComments(issue)
comments.each
{comment ->
log.warn(comment.getRoleLevel())
if (comment.getRoleLevel() == <value>)
{commentManager.delete(comment)
}
}
}
Anyone know why?
I can manually delete each comment, but there are thousands of tickets.
Any guidance is appreciated.