Hello everyone,
I have full administrator access to a JIRA server, and I’m looking for a JIRA REST API endpoint that can provide the total number of users and the number of users who have used a license. I’ve reviewed the documentation, but I haven’t been able to find an endpoint related to this.
For example, I have 8,000 licenses, and 7,640 are currently in use. I’d like to retrieve this data to set up an automation.
Does anyone know if there’s an API about this topic ?
Any guidance would be greatly appreciated!
Thank you,
Damiao
As far as I know, there’s no official public REST API for license usage in Jira Server.
You can get that data directly through UI by this URL: /plugins/servlet/applications/versions-licenses however I won't suggest parsing the HTML for sure.
You can use Java API to get those counts, hopefully this will work
def applicationManager = ComponentAccessor.getComponent(ApplicationManager)
def jiraSoftwareApp = applicationManager.getApplication("jira-software")
def userManager = ComponentAccessor.getUserManager()
def usersWithAccess = userManager.getUsers().findAll {
applicationManager.getUserApplicationAccess(it).any { app -> app.key == "jira-software" }
}
return "Users using a Jira Software license: ${usersWithAccess.size()}"
The solutions for Jira Server may not fulfil your request. I hope that helps.
Hello @Tuncay Senturk _Snapbytes_
Thank you for your reply.
Yes, I was able to find the total number of licenses.However, to create an automation I also need the total of licenses used.
I found this documentation related to application Role, I’m not sure if it will be helpful, but I’ll give it try.
https://docs.atlassian.com/software/jira/docs/api/REST/9.2.0/#api/2/applicationrole-getAll
In order to run this Java API code, do I need to run it on Jira Script console ?
Thank you again for your attention!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Tuncay Senturk _Snapbytes_ ,
I was able to get those answer here in this doc: https://docs.atlassian.com/software/jira/docs/api/REST/9.2.0/#api/2/applicationrole. It provides the total number of users and the number of users who have used a license.
thank you !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.