How to get a list of users is part of ABC group and they are not part of level 1 or 2 approver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 02:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 03:20 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 03:31 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 03:37 AM
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??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 03:42 AM - edited 07-20-2023 03:45 AM
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