It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Finding Issues Owned by Inactive Users with JQL without buying additional stuff

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()'.

5 answers

3 accepted

1 vote
Answer accepted

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.

1 vote
Answer accepted

For Jira Cloud, use 

assignee not in membersOf("jira-software-users") and statusCategory != Done

I like the statusCategory != Done.  Initially, I had all categories listed.  Thanks!

Like Eero Sario likes this
0 votes
Answer accepted
Ignacio_Pulgar Community Leader Dec 08, 2017

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")

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.

Ignacio_Pulgar Community Leader Dec 08, 2017

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.

Ignacio_Pulgar Community Leader Dec 08, 2017

Right, querying the DB is not possible on Cloud.

I'd suggest opening a ticket with Atlassian Support so that they perform the query for you:

https://support.atlassian.com/contact/#/

Alternatively, I think you may develop a solution which queried one of the JIRA REST API's:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.1568.0/

Ignacio_Pulgar Community Leader Dec 09, 2017

I've just tested this on Cloud:

inactive.jpg

So, you may:

  1. save a filter like: assignee in membersOf("inactive-users")
  2. add a Pie Chart gadget to a dashboard based on the assignee field, set to use the filter created in the previous step.

The pie chart will show the list of assignees in the group inactive-users, (checked it works too) and their names will contain a link to view all issues assigned to that inactive assignee.

Of course, this approach requires some manual work for adding inactive users to the inactive-users group, but that's the easiest workaround I can think of.

You may easily find all inactive users by appropriately modifying the following link:

https://<YOURS>.atlassian.net/admin/users?activeFilter=inactive

You may want to establish the practice of including users into that group at the time of user deactivation, so that you don't have to look for inactive users afterwards.

Hope it helps.

I tested and this is possible IF we assign users to inactive-users group when they leave.  I was surprised it still worked when the user had all access revoked.  Thanks!

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

listing using inactiveUsers() also includes unassigned tickets,  so you'd need to filter these results out with  "AND assignee != unassigned"

I used a filter like  "assignee not in ([list of active users])" and it worked without any changes to user group assignments

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you