Search code examples
jirajira-rest-apijira-pluginjira-rest-java-api

Get number of jira users


How can I get the number of JIRA users? And how can I get the user number JIRA is licenced for?

I'll appreciate if you provide examples using different layers e.g. Using database query, or JIRA API call, or a method to call in JIRA plugin. // JIRA instance is using Crowd


Solution

  • This is how to get users from group jira-users. Only this user group affects license user count.

    ComponentAccessor.getGroupManager().getUserNamesInGroup("jira-users").size();
    

    You could also inject groupManager in your plugin.

    I don't know how to get user number JIRA is licenced for. I think it's not stored in your instance data or DB.