Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

hide the ui action if the sla associated with that ticket is breached

SanjayYogi18_
Tera Contributor

hide the ui action if the sla associated with that ticket is breached how can i do with script include or any other to hide that ui action 

 

1 REPLY 1

siva krishna M2
Tera Guru

Hello @SanjayYogi18_ ,

 

In the UI action set Condition using script include where we can check the associated sla for the incidents has breached or not

 

Condition: new slabreach().slabreached(current.sys_id)

 

sivakrishna3_0-1707023838669.png

Script include name: slabreach

Function: slabreached

slabreached: function(sysid)
{
var answer = true;
var tasksla = new GlideRecord('task_sla');
tasksla.addQuery('task',sysid);
tasksla.addQuery('has_breached',true);
tasksla.query();
if(tasksla.next())
{
answer = false;
}
return answer
},

 

sivakrishna3_1-1707024037992.png