How can I search for issues assigned to inactive users in JIRA cloud? We have to make people inactive when they leave (because we get charged by the user). I found this link: https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_user_functions in a response to a similar question, and it seemed to say that you can just put assignee in inactiveUsers() in your JQuery, but when I do that I get a message Unable to find JQL function 'inactiveUsers()'.
The JQL function inactiveUsers() is provided by ScriptRunner plugin, and it won't work unless your JIRA instance has that additional addon, which seems not to be the case.
There's no easy native alternative.
A workaround could be adding inactive users to a group (ie: inactive-users) for flagging those users as inactive.
Once all inactive users were in that group, you would be able to get all issues assigned to an inactive user by executing this JQL query:
Assignee in membersOf ("inactive-users")
How about this one?
assignee not in membersOf("access-jira")
It shows all issues that have been assigned in the past to users that are now no longer active. You could narrow down your search by also filtering only on issues that are still open.
For Jira Cloud, use
assignee not in membersOf("jira-software-users") and statusCategory != Done
Use this JQL statement to display all issues assigned to inactive users.
assignee in (inactiveUsers())
If you wish to reduce the results to display issues which are incomplete, include the statusCatgory as suggested by @Eero Sario :
assignee in (inactiveUsers()) AND statusCategory != Done
This would only work if the person was active. They are still members of groups, so I tried to search by "Assignee in membersOf ("HCP") and assignee = m..." And all of the "M" names that are active came up but not hers.
I think we would just have to re-activate her briefly to do the search, then de-activate her immediately. It just seems counterintuitive that we can't search for things assigned to inactive persons.
Mmm... Found this:
https://confluence.atlassian.com/jirakb/search-for-inactive-users-346947771.html
The workaround then would be querying against the database.
The KB article above contains the SQL sentence for getting the list of inactive users, so now you just need to build a longer SQL sentence using the one in the KB as a subquery of a bigger query.
I don't think we have db access since we are using the Cloud version.
I used a filter like "assignee not in ([list of active users])" and it worked without any changes to user group assignments
I like the statusCategory != Done. Initially, I had all categories listed. Thanks!
listing using inactiveUsers() also includes unassigned tickets, so you'd need to filter these results out with "AND assignee != unassigned"
Thank You!
Massively helpful on Server. Thanks!
hello @Gautham Hari for the assignee in inactiveUsers() ORDER BY assignee ASC command, it's what I looked for
uu, nice thanks!
Hello @Gautham Hari ,
This query works just fine: assignee in inactiveUsers() ORDER BY assignee ASC
But the point here is how to filter only the tickets for one specific deactivated user. Let's say that the count of them is 500 and I would like to find only the ticket created by one specific person, in order to assign them to another colleague.
I tried different options but looks like this function doesn't accept any arguments. If you have to share any additional details, I will be grateful.
I personally succeeded to narrow the search results by:
1. Putting the membersOf("the team") - this reduced the all found results only to this specific team.
2. The adding inactiveUsers() function with the AND operator helped to reduce the final result.
3. And of course, adding some additional criteria like filtering by status or creation date range can make the final result even better and smaller.
use: reporter in (inactiveUsers()) AND reporter = "username" ORDER BY created DESC to get issues created by a particular inactive user.
Thank you @Ganga Bopaiah .
The point with the reporter = "username" is not relevant here because the username doesn't exist and it causes to system error.
No, in place of username add the text that an inactive user is displayed with. For example: in our Jira when a user leaves, the user details like first name, last name, even username is not searchable, but the user id, like their employee number which still shows on the ticket that was assigned to the user (now inactive), can be used in the query.
Even better, save "reporter in (inactiveUsers())" in a filter, use the filter in a dashboard gadget like a pie chart that's divided on the reporter. Click on the reporter you are looking for; it opens in a JQL filter and you will have the right filter query.
It works only if you delete users from Jira when they retire. It does not work if they were disabled.
I found this works but only if you know the email the deactivated user(s) used to have:
assignee = "name.lastname@company.com"
assignee id still works ok - thanks
Thanks, this one worked for me. @Abraham Castillo
assignee id didn't work for me. Maybe id tables were changed later. I see some change in the backend storing user profile pics (that's where I got the id from.. html source)
@Archit Bohra See the top accepted answer here - I've been assigning terminated users to an "Inactive Users" group with no product access, and it works like a charm.
It complains group not found.
Thank you so much this worked for me! @Abraham Castillo
@Abraham Castillo this here is the BEST solutuion - thank you!
For me I used another workaround because
didn't work for me.
I opened one of the dashboard's we use and select quick filters: (you can get user ID from somewhere else also)I selected the inactivated user from the quick filters. Then on the browser address bar, I find the Assignee ID something like this:/jira/software/c/projects/ABC/boards/9999?assignee=abcdefg12344556(id)then copied that ID and use it in JQL string
assignee in (abcdefg12344556) AND project = ABC
another way of doing it I guess.
It looks like you're new here. Sign in or register to get started.