select random user from group

Deepthi13
Tera Expert

i want to select random user from a hard coded group, pls find below logic and suggest.

if it goes inside if it should consider approverList , if it goes else condition it should consider hard coded group and it should send approve randomly for any one person in group

 

  if (approverList.length == 0) {
approverList.push(gs.getUserID());
return approverList;
} else {
var group = new GlideRecord("sys_user_group");
group.addQuery("sys_id", "d0b0871adbf45780a167d6fa4b9619a0");
group.query();
if (group.next()) {
i=0;
for( )
return group;
}
}   

15 REPLIES 15

i found da issue now i got approval one...

Approver count: 1 - 867f2008dbc3d780626ce9ec0b961912  - log

but i got as error

find_real_file.png

 

can you place the cursor on the error and share what the error was.

Hello Deepthi,

Do you have any update on this? If the issue is resolved, kindly mark my comment as a correct answer so that the question is moved to the solved list.

Approver count: 1 - 867f2008dbc3d780626ce9ec0b961912  - log

but i got as error

find_real_file.png

asifnoor
Kilo Patron

Hello Deepthi,

If the issue is resolved, kindly mark my comment as  a correct answer so that the question is moved to the solved list.