Trigger an event from a business rule on Task_SLA

jsnmllr1981
Kilo Expert

I created a business rule that is set to run when the Business Elapsed Percentage hits 50%, this is an after rule set to run on update and insert.

I can not get the sla.warning event to fire.  I would like to pass who the assigned to is on the task of the sla.  Here is my code

(function executeRule(current, previous /*null when async*/) {
	var task = new GlideRecord('task_sla');
	task.addQuery('task', current.sys_id);
	task.addActiveQuery();
	task.query();
	// Add your code here
	while (task.next()) {
		gs.eventQueue('sla.warning', task, task.getValue('assigned_to'),'TriggerRule');
	}
})(current, previous);

 

5 REPLIES 5

Chavan AP
Tera Guru

Hi Jeson,

 

 

I would request you to trigger and event from Workflow  at 50% elapsed time of a SLA.

 

It would be much easier to achieve .

 

find_real_file.png

 

Regards,

 

Ajay

 

 

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****

I tried that, but there seems to be an issue with these notifications going out off business hours, I was seeing if there was a better way

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You can try using something as below.

(function executeRule(current, previous /*null when async*/) {

		gs.eventQueue('sla.warning', current, current.task.assigned_to,current.task.number);
	
})(current, previous);

 

In addition, why not use Workflow with a Timer activity to take of the same.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

jsnmllr1981
Kilo Expert

I am not even sure my Business rule is running, I added an action to change the short description and it is not changing. Here is my rule

 

find_real_file.png

find_real_file.png