I want to filter issues by: assignee is current user and last comment not by current user

Sandra Axelsdottir [Tempo] September 7, 2015

Is this possible?

What I´m trying to achieve is to have a filter results gadget on my dashboard that shows me issues that I need to respond to; I´m the assignee, but last comment is made by someone else than me.

I hope my need is clear and someone has an excellent and simple solution smile

3 answers

2 votes
Paulo Hennig
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 7, 2015

Hello Sandra,
You can filter by the assignee as the following:

reporter = currentUser()

But you can't filter by comments, for this I'd suggest you to set your user as a watcher on the following issue:

 

Sandra Axelsdottir [Tempo] September 7, 2015

Hi and thanks. I know about the basic filters. It's the comment one I need. I´m hoping there is a workaround to achieve this.

0 votes
Nick September 7, 2015

I think there is no way to achieve this without an add-on.

 

One way to do this would be to create a plugin with a JQL function in it that returns the user who created the last comment. This may be slow, however.

 

An alternative approach which will give faster queries would be to add a lastCommenter custom field which can be searched in JQL.

Then you can either

1) create a listener (in a plugin) which stores the editor or creator of the last comment in that custom field whenever a EventType.ISSUE_COMMENT_EDITED_ID, EventType.ISSUE_COMMENT_EDITED_ID, or EventType.ISSUE_COMMENTED_ID event occurs.

2) use the JIRA automation plugin to create a rule that has an issue event trigger and check for the above events and you will still need to create a custom action which sets the lastCommenter custom field from the comments.

0 votes
GabrielleJ
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.
September 7, 2015

There is no other way to accomplish this right now without any add-on. If you wish to go that route, you need the JIRAScript runner plugin and a few scripting/coding skills.

  • Since a JQL needs to work with an issue's data, you need something to flag an issue that it's last commented by someone else not you. I suggest you use the "Status" for this one. You can use custom fields if you wish.
  • In your workflow, put a post-function to "Run a Script", or "Transition the Status" to something else and put in a condition to check the lastComment Id's if it's not equal to the assignee (or your ID)

A lot of projects are using this, even Atlassian Support site. You can ask them what they did if they are willing to share exactly, even the codes/script smile

Suggest an answer

Log in or Sign up to answer