The CreatorCon Call for Content is officially open! Get started here.

SLA Triggering Based on Caller's Group Membership

sravanku888
Tera Contributor

Hi Everyone,

 

We need to implement an SLA Definition that only attaches to an Incident if the Caller is a member of a specific group, say the Service Desk group.

 

The use case is:

1.Incident is created.

2.If the Caller (caller_id) is a member of the Service Desk group, the new Service Desk Group SLA should attach.

3.If the Caller is not a member of that group, this specific SLA should not attach.

 

Any advice, community articles, or examples of the script for the Advanced Condition method would be greatly appreciated!

 

Thanks in advance for your help!

1 REPLY 1

Kieran Anson
Kilo Patron

Hi,

SLAs support condition rules which allow you to use a script include to further validate whether an SLA should attach.

 

  1. Navigate to 'SLA Condition Rules'
  2. Create a new SLA condition record e.g 'Is Service Desk Caller'
  3. Create a new script include that extends SLAConditionBase
  4. Update the condition rule created in step 2 with the script include
  5. Create your SLA and reference the SLA condition created

KieranAnson_0-1760455085757.png

KieranAnson_1-1760455133375.png

 

var ServiceDeskCallerSLA = Class.create();
ServiceDeskCallerSLA.prototype = Object.extendsObject(SLAConditionBase, {

	attach: function(){
		//Check the filter condition first
		if (!this._conditionMatches(this.sla.start_condition))
			return false;

		//Check the caller is a member of the service desk group
		var callerId = this.task.getValue('caller_id');
		//Below will only work in global
		//consider storing sysId as a property
		var isMember = gs.getUser().getUserByID(callerId).isMemberOf('679434f053231300e321ddeeff7b12d8');
		return isMember;
	},
	
    type: 'ServiceDeskCallerSLA'
});