Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,359,785
Community Members
 
Community Events
168
Community Groups

List of all users (with/without issues assigned)

Since Jira has a limitation about filter all users (only filter users with issues assigned), I need to list all users and check what are the ones without an issue assigned. I'm thinking that using Script Runner for this would be good, but I don't know how to do it. 

Has anybody an idea?

1 answer

0 votes
Tarun Sapra Community Leader Sep 11, 2018

Hello @Jay Salvay

If you know the group of users whom you might want to check if they have any issues assigned or not, then you can follow the approach as mentioned here

https://community.atlassian.com/t5/Jira-questions/JQL-Can-I-list-users-who-don-t-have-any-issues-assigned-to-them/qaq-p/384607

Hi @Tarun Sapra, thank you for your sharing. I saw this post and the issue in following this approach is that I have 30 projects and 150 devs, so I will have a huge 2 dimensional frame. That's why I was looking to get some piece of code to list all users from script runner. Do you have any idea?

Also, I tried to create a a filter for every user in order to show them into a dashboard, but the JIra dashboard doesn't allow to add more than 15 frames of filtering issue gadget.

Do you know who can help me or where I can find some piece of code to get a list running some script?

Thank you in advance!

Tarun Sapra Community Leader Sep 12, 2018

Hello @Jay Salvay

Yes, you can do it via executing a script in the script console, it's easy actually. 

Use "UserManager" in Jira api to traverse the users and then for each user execute the JQL in code

"assignee=username"

Then use a list object to collect the names of the users which have 0 results returned for the above JQL. And return this list object from your script.

Thank you @Tarun Sapra. I have been tried, but not able to do it. Do you know where I can get an example? I tried googling for my 7.8.1 JIRA version, but I don't get a "UserManager' function: https://www.google.com.ar/search?ei=ChKZW-yRMcaWwASF1oKgDQ&q=UserManager+%28Atlassian+JIRA+7.8.1+API%29&oq=UserManager+%28Atlassian+JIRA+7.8.1+API%29&gs_l=psy-ab.3...7568.10825.0.10959.4.4.0.0.0.0.145.323.2j1.3.0....0...1.1.64.psy-ab..1.0.0....0.YmTWM8ooRPI

 

Can you please help me out?

Tarun Sapra Community Leader Sep 12, 2018

Hello @Jay Salvay

UserManager is available via componentAccessor

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/component/ComponentAccessor.html

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/component/ComponentAccessor.html#getUserManager--

 

Using userManager you can easily get list of users or if your users belong to a generic group then you can also use groupManager instead of userManager. groupManager is also available in ComponentAccessor (it's central point to get all managers)

Point is to get usernames via any manager in order to execute the JQL inside the code to check the number of issues returned whether zero or not.

Once you have the user manager you need to do JQL search in code itself

something like

https://scriptrunner.adaptavist.com/latest/jira/recipes/misc/running-a-jql-query.html

 

or this

https://community.atlassian.com/t5/Marketplace-Apps-questions/How-to-run-JQL-query-inside-Groovy-script/qaq-p/194691

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

168 views 1 6
Read article

Atlassian Community Events