How to write JQL to find last assignee of a issue was in a specific user role of specific project?

Alana Fernando Community Champion Aug 01, 2017

I want to filter out ticket list which matches below criteria,

  1. tickets assignee changed within last 5 days.
  2. tickets in project "LCH"
  3. and assignee was in "client" role.

currently i have below query which is by the way not working. 

assignee was in usersInRole("LCH", "Client") and assignee changed AFTER startOfDay(-5d)

 

thank you in advance,

1 answer

1 accepted

This widget could not be displayed.

Hello Alana,

It seems that you are using JQL tricks plugin, (usersInRole) function.

From the docs it seems it supports only "in" operator and not "was in" operator as was in operator searches the history of the issue-

usersInRole([project],role) 

Function To find issues based on users in a specific role in a specific project. Project role made optional in 7.0.

Since : v1.0

Usage:

  • assignee in usersInRole("TST","Administrators") - Returns all the issues assigned to one of the Administrator of project 'TST'
  • assignee in usersInRole("Administrators") - Returns all the issues assigned to users with Administrator role in any of the projects.
Tarun Sapra Community Champion Aug 01, 2017

For the part "tickets assignee changes in last 5 days" you can try this , as it's working

assignee changed DURING (startOfDay(-5),now()) 
Alana Fernando Community Champion Aug 01, 2017

Yes Tarun, i think you are correct. but still is there a way of filtering out my requirement?

I mean is there a way append assignee was in client role to the JQL you provided above? 

 

Tarun Sapra Community Champion Aug 01, 2017

JRIA out of the box doesn't provide way to filter on roles, the JQL tricks plugin provides to filter based on current state but your requirement is "was in" thus not only current but past as well. Hence right now I am not sure about it, I will come back to you if something comes to my mind.

Alana Fernando Community Champion Aug 01, 2017

Thanks Tarun

Alana Fernando Community Champion Apr 02, 2018

hi @Tarun Sapra, some jtrics functions are not associating with assignee.

 

I tried assignee was in user in role ("Client") but JIRA shows and error that saying 

"A value provided by the function 'usersInRole' is invalid for the field 'assignee'."

 

therefore considering current situation i am accepting your answer which is 

JRIA out of the box doesn't provide way to filter on roles, the JQL tricks plugin provides to filter based on current state but your requirement is "was in" thus not only current but past as well. Hence right now I am not sure about it, I will come back to you if something comes to my mind.

thanks for the help 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

48 views 2 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you