Get all jira comment Since a specific date using groovy

Ansar Rezaei
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.
March 12, 2020

Hi

I need to collect all comment's on the Issue since a date(for example, a week ago) on the script field thanks to Adaptivist Script Runner. I find this method(getCommentsForUserSince) on CommentManager Interface, but I can't find any tutorial on how to use it, and I don't know is it suitable for this case or not. Could you help me by editing my code to find the solution?

 

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.component.ComponentAccessor

def commentManager = ComponentAccessor.getCommentManager()

def comment = commentManager.getComments(issue)
def results = "</br>"
if(comment != null){
for (item in comment) {
results = results + "</br>" + item.authorFullName + "</br>" + item.body + "</br>"
}
}
return results

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events