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

3 answers

0 votes

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.

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.

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/

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.

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.

0 votes

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
Community showcase
Posted Oct 16, 2018 in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

78 views 0 3
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