JQL: Last comment is not from assignee

Sean Roberts June 18, 2020

Our users want to see issues where last comment is not from the assignee. This helps with identifying issues that need attention as workflows do not cover all scenarios.

I've found this function but not been able to use `assignee` with it:

issuefunction in lastComment(...)

 

7 answers

1 vote
Kathy Barton
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2020

I'm looking for the same thing. We require developers to add comments every day so I need to be able to check to see if there is a comment from the last day AND if that comment is by the assignee. Please consider adding this feature. 

1 vote
stefantinger July 15, 2020

Question is only one month old and i am looking exactly for the same now ^^
Would be really interesting if it is somehow possible.

Otherwise I probably need to open a feature request...

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2020

You would need to write a JQL function for that - the standard functions of JQL look only at the field data, they don't look at attributes of the data (the author of a comment is not the main point of the comment)

0 votes
Dominick Willis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 1, 2022

A little late to the party, but I thought I'd contribute anyway as I sank a *lot* of time into researching this very thing a while back for searching tickets assigned to my team that needed an update.

I was able to get a workable set of results using the ScriptRunner 'Expression calculator ' function:

issueFunction in expression("(statusCategory not in (Done)) AND filter=10502", "customfield_10600 != assignee") OR statusCategory not in (Done) AND filter = 10502 AND cf[10600] is EMPTY

Filter 10502 is just my filter for narrowing down to ticket specific to my team and custom field 10600 is our field ID for the 'Last Commenter' field. So this is searching for open (not Done) tickets assigned to my team where the Last Commenter is not the Assignee. There's a second clause to account for tickets assigned to the team which have had 'no' comment, as that isn't covered by the expression function.

I hope this is useful for you.

0 votes
stefantinger July 27, 2021

Just for completion, i resolved it that way:
As we already using ScriptRunner, i created a Script Field (Template 'Number Field') and used the following script

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

def commentManager = ComponentAccessor.getCommentManager()
def lastComment = commentManager.getLastComment(issue)

if (lastComment != null && issue.getAssignee().getUsername().equals(lastComment.getAuthorApplicationUser().getUsername()))
return 1

return 0

 Now i can just check the field if the last comment is from the assignee or not.

0 votes
Artem_Danylkov_SaaSJet_ June 23, 2020

Hello Sean,

It's hard to find last comment is not from the assignee in JQL function, so i recommend you our addon Issue History. It help you to monitor all changes made with issues, including history of adding comments.

To get this data you need to choose comment field at the column manager.

You can also select a list of issues with comments written by the specific user you are interested in.

Best regards

Artem

Sean Roberts June 24, 2020

Thanks for the tip. But we have a big Jira installation so the cost would be prohibitive.

It's expected by the users that such filtering should be native.

Artem_Danylkov_SaaSJet_ July 2, 2020

Hello Sean,

If this can solve your problem then I would recommend the lite version of our app Issue History Lite it has main functionality of the application, but is much cheaper.

Hope it helps

Artem

0 votes
Pavel Junek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2020

Hi Sean,

You can look to Adaptavist Script Runner Documentation.

You can try this:

project = "XX" and issueFunction in lastComment("by pavel.junek")

Cheers,

Pavel 

Sean Roberts June 18, 2020

Pavel - We already use that function, though typically with `currentUser()`. However, we want to filter on `lastComment(assignee)` but it doesn't seem to be available as an option.

Pavel Junek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2020

Ah, so in this case, I'm afraid that's not really the possibility here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events