Forums

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

SIL user picker warning

Neha Sharma
Contributor
September 5, 2018

Hi,

We have a user picker SIL script configured for one of our custom fields. For one particular user, the auto-complete is not working. The SIL script is - 

function getUsers(string [] groups){
string [] users;
for(string group in groups){
string [] currentGrp;
currentGrp = addElement(currentGrp, group);
for(string user in usersInRole(project, currentGrp)){
users = addElementIfNotExist(users, user);
}
}
return users;
}
string [] groups = {"Developers", "Administrators"};
string [] users;

if(isIssueContext()) {
users = getUsers(groups);
} else {
string [] projectsYouAreOn = projectsWithPermissionForUser(currentUser(), "ASSIGN_ISSUES");
for (string prj in projectsYouAreOn) {
string [] members = projectMembers(prj);
for (string member in members) {
users = addElementIfNotExist(users, member);
}
}
}

string [] res;
for (string user in users) {
if (contains(user, argv["query"])) {
res = addElementIfNotExist(res, usernameToUserKey(user));
}
}
return res;

The user whom I'm searching for and is not appearing as auto-complete is added to the Developers project role though.

Can someone please share their thoughts on this ?

Thanks in advance,

Neha

1 answer

0 votes
Alexey Matveev
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.
September 5, 2018

Hello,

Could you use the logPrint method to log info into the atlassian-jira.log file? 

https://confluence.cprime.io/display/SIL/logPrint

You should log the res variable and see if the user is there.

Suggest an answer

Log in or Sign up to answer