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()
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.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.