workflow Run script for remove group members, group roles , remove parent group and active false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 07:17 AM
Hi Everyone,
I have a requirement for deactivate the group
i need to do this through work flow
Could you please help me out
1. Remove parent group
2. Remove all assigned roles
3. Remove all group types
4. Remove all members
5. Remove default assignee
6. Active = false
7.DO NOT remove manager
8.Deactivation approval required by group manager, CMDB admin, and CFS team manager; there should be a warning message or reminder in the approval page when they press approve – “have you transferred all active tickets, tasks, and applications?” Yes approved. No do not proceed (but DO NOT reject).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 07:34 AM - edited 12-13-2024 07:35 AM
Way way way easier to do it in Flow Designer since you won't need any code.
Assuming you have a Catalog Item where they select a group to deactivate.
TRIGGER (Catalog Item)
1 - Get Variables (from the Catalog Item definition you built)
2 - LookUp Records (sys_user_grmember) where group = group variable from (1)
3 - For Each of (2)
4 - Delete Record (at iteration of 3)
5 - LookUp Records (sys_group_has_role) where group = group variable from (1)
6 - For Each of (5)
7 - Delete Record (at iteration of 5)
8 - LookUp Record (singluar!) (sys_user_group) where sys_id = group variable from (1)'s sys_id
9 - Update Record (from 8 )
--- active = false
--- type =
--- default assignee =
--- parent =
Zero code needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 08:09 AM
Hello uncle,
Thanks for your response
but i had workflow for creating new group and update exiting group now i want update the same workflow for deactivate the group
Could you please provide the script