Targeted Searching

Summary

The targeted searching feature, introduced in version 3.2.7, allows user to search additional last comment data types besides the content. Users may now use Jira's advanced search to search for issues whose last comments were made by a particular author (user)group, project role, or created date. The link for advanced search is found in the issue navigator page next to all the filters.

The targeted search will only return results from the last comment added to an issue.

Any of the targeted search functions can be used one-time in JIRA advanced search or they can be used in any filter to return Last Comment results in customized reports.

Prerequisites

  • JIRA 6.3+
  • Last Comment Custom Field Plugin version 3.2.7+

Table of Contents 

 

Activating Targeted Searching

  1. Create a custom field of type CCC Last Comment(if it doesn't already exist) or Edit your Last Comment custom field.
  2. Edit the searcher for the custom field; choose Last Comment Searcher. (Edit the custom field searcher if there's already a Last Comment Custom Field Type)
  3. Re-Index JIRA
  4. Once indexing completes you are ready to use the new advanced JQL functions to do targeted Last Comment searching.

 

 

Examples of Searching

With the exception of the basic comment content search, the following examples are limited to Jira's advanced search and have no basic search equivalent.


 

Basic Comment Content Searching

JQL Example Search
"<last comment field name>"~athlete
Where: <last comment field name> is the name of the Last Comment Custom Field
Returns:only issues whose last comment contained the word 'athlete'

Supported JQL Operators

=!=~!~>>=<<=ISIS NOTINNOT INWASWAS INWAS NOTWAS NOT INCHANGED

(error)

(error)(tick)(tick)(error)(error)(error)(error)(error)(error)(error)(error)(error)(error)(error)(error)(error)

Back to Top


 

Last Commented Author (user) Search

lastCommentAuthor( username )

Supported Fields:
Where:username - this can be the email, the username, or the first and last name of a user
Returns:only issues whose last comment was made by a user

Supported Operators

=!=~!~>>=<<=ISIS NOTINNOT INWASWAS INWAS NOTWAS NOT INCHANGED

(error)

(error)(error)(error)(error)(error)(error)(error)(error)(error)(tick)(tick)(error)(error)(error)(error)(error)

Examples

  • Find issues whose last comment was made by user jsmith. The following examples are equivalent searches since idkey, and issue are aliases of issuekey.

    issuekey in lastCommentAuthor("jsmith")

    OR

    id in lastCommentAuthor("jsmith")

    OR

    key in lastCommentAuthor("jsmith")

    OR

    issue in lastCommentAuthor("jsmith")
  • Find issues whose last comment was made by users who have "john" or "smith" in their display name. This search is not an exact string search. In this example, both "john" and "smith" are separate search terms. Please see next example for a more accurate search for "John Smith".

    issuekey in lastCommentAuthor("john smith")
  • Find issues whose last comment was made by users who have "john" and "smith" in their display name.(i.e. someone named John Smith). The following examples are equivalent. Notice how the search string is encompassed by escaped quotation marks in the first example to indicate it is a single search term.

    issuekey in lastCommentAuthor("\"john smith\"")

    OR

    issuekey in lastCommentAuthor("john") and issuekey in lastCommentAuthor("smith")
  • Find issues whose last comment was made by users whose username or display name start with "john". In this example, the * character acts as a wild card.

    issuekey in lastCommentAuthor("john*")

Back to Top


 

Last Commented Group Search

lastCommentGroup( groupName )

Supported Fields:
Where:groupName - the name of a JIRA security group
Returns:only issues whose last comment was made by a user in a particular group

Supported Operators

=!=~!~>>=<<=ISIS NOTINNOT INWASWAS INWAS NOTWAS NOT INCHANGED

(error)

(error)(error)(error)(error)(error)(error)(error)(error)(error)(tick)(tick)(error)(error)(error)(error)(error)

Examples

  • Find issues whose last comment was by users in the "customer" group. The following examples are equivalent to each other.

    issuekey in lastCommentGroup("customer")

    OR

    issue in lastCommentGroup("customer")

    OR

    id in lastCommentGroup("customer")

    OR

    key in in lastCommentGroup("customer")

     

     

Back to Top


 

Last Commented Role Search

lastCommentRole( projectRole )

Supported Fields:
Where:projectRole - The name of a project role.
Returns:only issues whose last comment was made by a user in a particular role

Supported Operators

=!=~!~>>=<<=ISIS NOTINNOT INWASWAS INWAS NOTWAS NOT INCHANGED

(error)

(error)(error)(error)(error)(error)(error)(error)(error)(error)(tick)(tick)(error)(error)(error)(error)(error)

Examples

  • Finds issues whose last comment was by users in the "developers" role for a project. The following examples are equivalent to each other.

    issuekey in lastCommentRole("developers")

    OR

    issue in lastCommentRole("developers")

    OR

    id in lastCommentRole("developers")

    OR

    key in lastCommentRole("developers")

Back to Top


Last Commented Created Date Range Search

lastCommentCreateDate( fromDate[, toDate] )

Supported Fields:
Where:

fromDate - the date to start searching from.

toDate(optional) - the date to stop searching. If this parameter is skipped, the current date will be used.

This function accepts the following date formats to hard-code the range:

  • "yyyy/mm/dd"
  • "yyyy-mm-dd"

This function also accepts a date relative to the current date.

  • Use "-d" to indicate days
  • Use "-w" to indicate weeks

Any of the date search functions can be used one-time in JIRA Advanced Search but can be used in any filter to return Last Comment results in customized reports.

Returns:

Returns issues whose last commented create date falls between two dates (inclusive).

Supported Operators

=!=~!~>>=<<=ISIS NOTINNOT INWASWAS INWAS NOTWAS NOT INCHANGED

(error)

(error)(error)(error)(error)(error)(error)(error)(error)(error)(tick)(tick)(error)(error)(error)(error)(error)

Examples

  • Find issues whose last comment was created thus far in 2014. The following two date format examples are equivalent to each other.

    issuekey in lastCommentCreateDate("2014-01-01")

    OR

    issuekey in lastCommentCreateDate("2014/01/01")
  • Find issues whose last comment was created a week ago to the current date.

    issuekey in lastCommentCreateDate("-1w")
  • Find issues that have been commented on since yesterday.

    issuekey in lastCommentCreateDate("-1d")
  • Find issues whose last comment was created between February 15, 2014 and July 04, 2014 inclusive.

    issuekey in lastCommentCreateDate("2014-02-15","2014-07-04")
  • Find issues whose last comment was created between the beginning of 2013 up until 2 weeks ago.

    issuekey in lastCommentCreateDate("2013/01/01","-2w")

Back to Top


Advanced Search Queries

The following examples show how our targeted search functions can work with other JQL statements.

Examples

  • Find issues in a particular project whose last comment is in a project with the with a key of TEST and whose author is in the "customer" group and also in the "developers" role.

    project = TEST and issuekey in lastCommentGroup("customer") and issueKey in lastCommentRole("developers")
  • Find issues whose last comment custom field named "Final Comment" contains the words "business" and "strategies" and whose author is in either the "managers" group or the "marketing" group.

    "Final Comment" ~ "business strategies" and lastCommentGroup("managers marketing")
  • Find issues whose last comment is from an author who is in the "managers" group and the "marketing" group.

    issuekey in lastCommentGroup("managers") and issuekey in lastCommentGroup("marketing")
  • Find issues whose last comment is an author who is in the "prjmgr" group that was created anytime from two weeks ago to yesterday. 

    This is a relative or floating date (rather then hard-coded) which means that if used in filters in the future it will always give the results relative to the day the filter was run.

    A typical last comment search is a report on all issues with comments created by project managers (prjmgr group) for the last two weeks.  The last comment search string below used in a saved filter would give management a good idea on the status of all issues worked on by the project managers over the last two weeks.  This is invaluable for doing quick status reports.

    issuekey in lastCommentGroup("prjmgr") and issuekey in lastCommentCreateDate("-2w","-1d")

Back to Top