Is it possible to create a script with "ScriptRunner" that runs a "JQL" and displays the last comment of the filtered issues?
How would you expect JIRA to show this information?
Actually I would like to analyze the content of the last comment and check if I was mentioned there (@username). I would like to get a list of issues where I was mentioned in the last comment.
It sounds like you're looking to create a JQL function then? You'd like to write a query like issueFunction in mentionedInLatestComment(currentUser()) and be returned a list of issues that match this function?
Yes, exactly!
Hi,
I am trying to achieve the same.
Based on research I have code which gives me the issue keys but does not know how to add comments to this. Some errors I got referring to the arrays that could not be created.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.event.type.EventDispatchOptionimport com.atlassian.jira.issue.MutableIssueimport com.atlassian.jira.issue.search.SearchProviderimport com.atlassian.jira.jql.parser.JqlQueryParserimport com.atlassian.jira.web.bean.PagerFilterimport com.atlassian.jira.component.ComponentAccessordef jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)def customFieldManager = ComponentAccessor.customFieldManagerdef issueManager = ComponentAccessor.issueManagerdef commentManager = ComponentAccessor.getCommentManager()def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def query = jqlQueryParser.parseQuery("project = XXX and labels = YYY")def issue_results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())def issueList = issue_results.issues.collect{issueManager.getIssueByCurrentKey(it.key,)}issueList.each{def issue = it as MutableIssue}
If you could help I am thrilled.
Best,
Simon
It looks like you're new here. Sign in or register to get started.