Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Identify Private Filters Owned by Inactive Users in Jira Data Center Using ScriptRunner

Over time, Jira instances accumulate a large number of saved filters. In many organizations, especially enterprise environments, some of these filters remain owned by users who have already left the company or whose accounts have been deactivated.

While this may seem harmless at first glance, inactive-user-owned filters can create several administrative and operational challenges — particularly when those filters are private.

This article demonstrates how to identify all private filters owned by inactive users using a simple ScriptRunner Groovy script for Jira Data Center.

The Script Retrieves all saved filters in Jira, checks whether the filter owner is inactive, identifies filters that are private (not shared with anyone), and generates a clean report with:

- Filter ID
- Filter name
- Owner information
- Direct URL to the filter

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchRequestManager

def userManager = ComponentAccessor.userManager
def searchRequestManager = ComponentAccessor.getComponent(SearchRequestManager)
def baseUrl = ComponentAccessor.applicationProperties.getString("jira.baseurl")

def results = []

searchRequestManager.getAll().foreach { filter ->

def owner = filter.owner
if (!owner) {
return
}

def ownerUser = userManager.getUserByKey(owner.key)
if (!ownerUser) {
return
}

def ownerInactive = !ownerUser.active

// Private filter = no share permissions
def privateFilter = filter.permissions == null || filter.permissions.permissionSet.isEmpty()

if (ownerInactive && privateFilter) {
results << filter
}
}

if (!results) {
return "No private filters found where owner is inactive."
}

return results.collect { filter ->
def ownerUser = userManager.getUserByKey(filter.owner.key)

"""Filter ID: ${filter.id}
Filter Name: ${filter.name}
Owner: ${ownerUser.displayName}
Username: ${ownerUser.name}
User Key: ${ownerUser.key}
URL: ${baseUrl}/issues/?filter=${filter.id}
-----------------------------"""
}.join("\n")

After identifying these filters, administrators may choose to:

  • Delete obsolete filters
  • Transfer ownership

Jira administration is not only about creating projects and workflows, but it is also about maintaining a healthy and governable ecosystem.

Hope that will help someone. :) 

 

1 comment

Peter_DevSamurai
Atlassian Partner
May 13, 2026

Thank you @Gor Greyan , this is quite helpful! I will forward to my team as well

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events