How to get a list of users is part of ABC group and they are not part of level 1 or 2 approver

raj149
Giga Guru

Hello experts,

 

I want to create a report by using below requirement

1 .User  active=true and User is part of ABC group(sys_user_grmember)

2.User is not assigned as level 1 or level 2 approver in a cost centre(cmn_cost_center)

 

How to get a list of users sys_ids by using script include.

 

Thanks in advance.

 

Best Regards,

Raj

14 REPLIES 14

Samaksh Wani
Giga Sage
Giga Sage

 

 

var user = new GlideRecord('sys_user_grmember');
user.addQuery('group', 'sys_id_of_ABC');
user.query();
while(user.next()){
gs.info(user.user);
}

 

 

 

Hello @raj149 

This is for your first point.

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Hello @Samaksh Wani 

 

Please check the 2 nd point as well in the requirement..

 

User  active=true and User is part of ABC group(sys_user_grmember) and 

User is not assigned as level 1 or level 2 approver in a cost centre(cmn_cost_center)

This is the requirement

 

best regards,

Raj

 

Hello @raj149 

 

Plz Tell me level 1 and level 2 is it any kind of field and approver is what ,just give some more details??

hello @Samaksh Wani 

 

Level 1 approver (referenced to user table)

Level 2 approver (referenced to user table )

both fields are present in cost center table

we need to check that user is part of 2 fields or not