Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Find all issues where a specific user is mentioned in comments

vyanktesh_chandely January 11, 2023

Hi Folks,

Can somebody help me with a JQL query which can provide me the list of all the issues in which a specific user has been mentioned in comments (especially latest comments).

Thanks.

2 answers

2 accepted

1 vote
Answer accepted
Ste Wright
Community Champion
January 11, 2023

Hi @vyanktesh_chandely 

As far as I know, this should work:

comment ~ <User ID>

^ You can locate the User ID by either...

  • Going to People (top navigation bar) > Search People and Teams > Searching for a user's profile.
    • Once you select a user, the User ID is the long alphanumeric ID after "people/" in the URL
  • Using a User Picker field in Search. For example, search for "Assignee =" and choose the user from the drop-down list as you type their name.
    • Once selected, the User's ID will appear in the search bar

Ste

vyanktesh_chandely January 11, 2023

Thanks @Ste Wright  ,

Thanks for a quick response, really appreciate it!

Also, what if I intend to find the user's mention in the last comment of the issue? If there a way?

Ste Wright
Community Champion
January 11, 2023

Hi @vyanktesh_chandely 

Not that I know of.

You have two options for this:

  1. Create an Automation Rule to populate the Last Comment into a separate custom multi-line text field, then search against that field instead
  2. Look for an App on the Marketplace which can extend JQL in this manner

---

Option (1) is possible to do using native features - and is simple to setup.

In summary, you would:

  • Create a custom multi-line text field - eg. Last Comment
  • Set the custom field to the "Wiki Style Renderer" in your Field Configuration (i.e make it rich text)
  • Create a rule to copy comments into this new field - which would look something like this...
    • Trigger: Issue Commented
    • Action: Edit Issue
      • Field = Last Comment
        • Text = {{issue.comment.last.body}}

You could then search against this field instead:

"Last Comment" ~ <User ID>

---

Note: You could create a second version of your Automation Rule to handle existing Issues.

This rule would only need to run once. Once it's setup, you can press a button in the rule called "Run Rule" to run it immediately, then just deactivate/delete it.

The rule would look something like this...

  • Trigger: Scheduled
    • Run a JQL Search = check to "TRUE"
    • JQL = summary is NOT EMPTY - this finds all existing Issues
  • Action: Edit Issue
    • Field = Last Comment
      • Text = {{issue.comment.last.body}}

---

Let us know what you think!

Ste

Like # people like this
1 vote
Answer accepted
Max Foerster - K15t
Community Champion
January 11, 2023

Hey @vyanktesh_chandely

You should be able to simply identify issues where a specific user has been mentioned in the comments by using this JQL phrase:

comment ~ "62850eb646f77e006f2244a5"

Where "62850eb646f77e006f2244a5" is the Account ID of the mentioned user.

Best, Max

vyanktesh_chandely January 11, 2023

Thanks @Max Foerster - K15t ,

Thanks for a quick response, really appreciate it!

Also, what if I intend to find the user's mention in the last comment of the issue? If there a way?

Like Max Foerster - K15t likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events