Hi there,
I need to get all users from a specific role on a project via SIL. For this i am using the routine:
usersInRole(project, role)
Returns the users that correspond to a certain role on the specified project.
For my specific case i use this script:
string[] users = usersInRole("PP", "Administrators");
return users;
It's "works" and outputs users with "|" as a delimiter. What is confusing is that is also returns old users aka, deleted.
We use Crowd but i have looking both in Jira User Management and Crowd management for the user(s) names that it outputs and they do not exits there (at least not popping up form search).
Any one have an idea of what could course this behavior?
Kind Regards
Hi Dennis, the "|" is the delimiter for array variables in SIL. The old user issue is a very odd behavior. I am assuming that these users must be in a database table somewhere even if they are not active and don't show up in Crowd. I think it is something that should be fixed so I have opened a support ticket. However, in the meantime, there is a workaround that will eliminate the invalid users:
string [] allUsersInRole = usersInRole("PP", "Administrators");
string [] currentUsers;
for(string user in allUsersInRole) {
if(hasPermission(1, user) == true) {
currentUsers += user;
}
}
return currentUsers;
This uses the hasPermissions() routine to make sure each user has the "Jira User" global permission.
Hi Jonathan,
Thanks for creating the ticket. Could I get you to add me to it, so I can post directly to that?
The script you have provided seems to give the same results, so I think providing more information about the environment i use it in might help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.