Remove user from Group

Jogam Anvesh
Tera Contributor

Hi community, 

 

I have a use case where when task was set to close complete(task will set to close complete automatically, once related groups were certified), under related links there is Group section (users belongs to that groups should be removed once certified) once task was set to close complete...

 

task in "cert_tas'k table. can any one j=help me out with this.

 

Thanks.

3 REPLIES 3

Sonu Parab
Mega Sage
Mega Sage

Hi @Jogam Anvesh ,
1] Create After Update BR on  'cert_task' table.(The table which having task records).
2] Add condition in When to run as  State Changes to close complete.

3]Use below script to delete users from group.

 var group = current.group_field; //'group_field' use your field  which store group on task.
    var gt = new GlideRecord('sys_user_grmember');
    gt.addQuery('group', 'group');
    gt.query();
    while (gt.next()) {
        gt.deleteRecord();
    }


If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thank you

Hi @Sonu Parab Thanks for responding !! Iam elobrating the use case little more...

PFA,

I have shared two Screen shorts, where the task state is closed, users in the Groups to be removed.

 

Thanks!!