show email client template option on the incident task form only for certain groups

Kalyani35
Tera Guru

Hi experts,

I want to show email client for incident tasks where certain groups are selected. 

For example, if group A, B or C are present as Assignment group on the incident task then only the email client option should be visible, else not. Is this possible?

Kalyani35_0-1689836935542.png

 

 

Thanks!

2 REPLIES 2

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Kalyani35 

Greetings!

you can try below onload client script

var grpName = 'YOURGROUPNAMEHERE';
var usrID = g_form.userID; //Get current user ID
var grp = new GlideRecord('sys_user_grmember'); //i'm just using GR in Client script, you can use script include for better performance)
grp.addQuery('group.name', grpName);
grp.addQuery('user', usrID);
grp.query(groupMemberCallback);
function groupMemberCallback(grp){
//If user is a member of selected group
if(grp.next()){
$('email_client_open').hide();
}
}

 

you can also do this by ACL way:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717937

Please hit the thumb and Mark as correct based on Impact!!

 

Kind Regards,

Ravi Chandra.

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Kalyani35 

Greetings!

Any feedback on my reply? were you able to do this?

Help others to find a correct solution by marking the appropriate response as correct answer and helpful!

 

Kind Regards,

Ravi Chandra.