Provider Notification

bgulshan
Tera Contributor

Under when to send I want a condition to be applied

If requested_for is a part of approval group, do not send the notification

 

 

4 REPLIES 4

phgdet
Mega Sage

@bgulshan 
Using the advanced condition and scripting to check if requested_for user is a part of approval group

answer = true;
//current contains the current record from the table to which the notification is linked
var approvalGrpId = current.document_id.assignment_group; //get the corresponding approval group ID here
var requestedForId = current.document_id.requested_for;
if(requestedForId && approvalGrpId && current.state == "not_requested"){
	var grMember = new GlideRecord("sys_user_grmember");
	grMember.addQuery("user", requestedForId);
	grMember.addQuery("group", approvalGrpId);
	grMember.query();
	if(grMember.next()){
		answer = false;
	}
}

bgulshan
Tera Contributor

@phgdet ,

Thank you for the solution tried it. It is not working

Any update?

Ankur Bawiskar
Tera Patron
Tera Patron

@bgulshan 

notification is on which table?

please share the complete screenshot

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader