How can I see JIRA tasks that are waiting on me based on the last comment being "~ currentUser()"?

Patrick S
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2018

I would love to be able to run JQL that shows which issues mention the currentUser in the most recent comment. The goal is to further extend this for dashboard use to see issues that may be waiting on the current user.

I was hoping to do this with the ScriptRunner with something like the following (which is not valid JQL), but am open to suggestions.

issueFunction in lastComment("~ currentUser()")

There is a built in comment ~ currentUser() comparison, so I'm hopeful. Any thoughts out there?

comment ~ currentUser()

 

1 answer

1 vote
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 26, 2018

Hello Patrick,

Thank you for raising this question.

Using Scriptrunner, I believe you will need to use the module Custom JQL Functions and perform the following steps:

- Use CommentManager.getLastComment(Issue issue) to obtain the last comment for each issue.

- Then, you can use Comment.getBody() to obtain the comment text.

- Finally, you can parse the content to search for the mention format, which is stored like this: [~username]. Once you extract this, you can compare the mentions to the argument passed to the JQL function.

Please, let me know if it works for you.

Patrick S
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2018

@Petter Gonçalves - Thanks for the quick feedback. I'll probably try that at some point, but I'm very rusty on Groovyscript so I'll need to wait until I've time to sink my teeth into it. In the meantime, if anyone else has already done something this awesome, feel free to share the love, otherwise I'll post what I build when I get it working.

Suggest an answer

Log in or Sign up to answer