Forums

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

How do you find unreferenced users in JIRA?

Christian Christian October 16, 2011

Basically I want to find out which users can be safely removed from my JIRA instance.

An additional requirement is to not only find users which have no reported or assigned issues but also users that are referenced by a project role or permission scheme.

I assume that I can do something like this only via a custom SQL query.

An addition to the question would be what happens if I delete a user that still has incoming references in the database. I guess there are more references than just "reported/created", "assigned", "project role" or "permission".

1 answer

1 accepted

0 votes
Answer accepted
Christian Christian November 20, 2011

An analysis of the users that are actually referenced in a JIRA instance can be made with reasonable effort based on the full XML export/backup.

This file can be processed using a simple script (e.g. Groovy) and you can use XPath to query for user references. Currently I'm using the following set of XPath's:

    • /entity-engine-xml/Project/@lead
    • /entity-engine-xml/Component/@lead
    • /entity-engine-xml/Issue/@reporter
    • /entity-engine-xml/Issue/@assignee
    • /entity-engine-xml/Action/@author
    • /entity-engine-xml/Worklog/@author
    • /entity-engine-xml/Worklog/@updateauthor
    • /entity-engine-xml/FileAttachment/@author
    • /entity-engine-xml/ProjectRoleActor[@roletype='atlassian-user-role-actor']/@roletypeparameter

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 20, 2011

Nice trick, I've always ploughed through the SQL

If you use the standard "delete user" in Jira though, it'll hoover out project roles and groups, so you may not really care about them. You might also want to scan the workflows (although using a nominated user in a workflow is a dodgy thing to do) and check the user's name is not used in any "user picker" custom field data.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events