Skip to main content

lastCommentedBy

Overview

The lastCommentedBy function allows you to search for issues where the most recent comment was written by a specific user, optionally constrained to a date range. This is useful for identifying issues awaiting response from a particular person or finding stale tickets where a specific user was the last to reply.

Syntax

issue in lastCommentedBy("subquery", "user", "start_date", "end_date")

Parameters

  • subquery (required): A valid JQL query that defines the set of issues to evaluate
  • user (required): The username, display name, or email address of the comment author
  • start_date (optional): The start date in format "yyyy/MM/dd HH:mm" or "yyyy/MM/dd", or a relative expression like -2w (see Relative date ranges)
  • end_date (optional): The end date in the same format as start_date

Supported Operators

  • in - issues matching the criteria
  • not in - issues not matching the criteria

Examples

Finding issues where a specific user was the last to comment

issue in lastCommentedBy("project = SUPPORT", "agent@example.com")

Finding issues where a user commented recently (within a date range)

issue in lastCommentedBy("project = SUPPORT AND statusCategory != Done", "john.smith", "2025/01/01", "2025/03/31")

Finding issues where the reporter was NOT the last commenter

issue not in lastCommentedBy("project = SUPPORT", "reporter")

Finding stale support tickets where an agent replied but hasn't received a response

issue in lastCommentedBy("project = SUPPORT AND assignee = currentUser()", "agent@acme.com", "2025/01/01", "2025/06/30")

Finding issues where a user commented before a cutoff date

issue in lastCommentedBy("project = DEV", "alice", "", "2025/02/01")

Relative date ranges (self-updating)

start_date and end_date also accept a relative expression — a leading - followed by a duration (w/d/h/m/s) — meaning "now minus that duration". Argon re-resolves the window every time the query runs (refreshed hourly), so the queue stays current without manual edits.

-- Tickets where an agent had the last word in the last week (awaiting customer reply)
issue in lastCommentedBy("project = SUPPORT", "agent@acme.com", "-1w")

-- Tickets a customer last replied to in the last 3 days (needs an agent response)
issue in lastCommentedBy("project = SUPPORT AND statusCategory != Done", "customer", "-3d")

See Relative dates for the full format reference.

Performance Considerations

  • The function analyzes the most recent comment from issues matching the JQL subquery
  • When available, indexed entity properties are used for fast evaluation
  • Using specific subqueries and date ranges can improve performance
  • User filtering is efficient as it operates on a single value per issue (the last commenter)

Error Handling

The function will return an error if:

  • Invalid date formats (must be "yyyy/MM/dd HH:mm" or "yyyy/MM/dd")
  • Non-existent users are specified
  • Invalid JQL queries
  • Required parameters (subquery or user) are missing
  • commented - Search for issues with matching comments by any criteria
  • changedBy - Search for issues where fields were updated