Is it possible to have a cron job with SQL Query which will list issues and comment details if it exceeds certain size? This Job with SQL Query should also notify via email to keep a watch if any new comments are created
Just to check, why do you want to use the SQL query to get the issues and comments? This can be done by doing a basic iteration of the issues list. For example:-
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.project.Project
def commentManager = ComponentAccessor.commentManager
def projectManager = ComponentAccessor.projectManager
def issueManager = ComponentAccessor.issueManager
def comments = [] as ArrayList<Comment>
projectManager.projectObjects.each { Project project ->
def issues = issueManager.getIssueIdsForProject(project.id)
issueManager.getIssueObjects(issues).each {
comments.addAll(commentManager.getComments(it))
}
}
comments.each {
if (it.body.length() > 50) {
log.warn "====>>> Comment Length Exceeded"
}
}
null
Please note that this sample code is not 100% exact to your environment. Hence, you will need to make the required modifications.
Also, the null is added at the end of the code to clear up any values and to avoid the error message from the Scheduled Job.
I hope this helps to solve your question. :)
Thank you and Kind regards,
Ram
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.