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.

SLA notifications are sent for more than 100 %

sharayukasar
Mega Expert

Hi all,

we have a workflow   on "task_sla" table for sending out the notifications   on different percentage (for 25% ,50% ,75% etc). But there are notifications which are sent for 110%,200% etc which is not what client want to receive. as per my understanding there is something that's updating the "task_sla" table, which is why the workflow is triggering again .

I found one Business rule "start workflow" which has current.update(); in it. I think its causing the notifications to be sent on percentage more than 100 % .but that BR is OOB . How to handle this situation??

Thanks in advance

1 ACCEPTED SOLUTION

anvesh_v
Giga Guru

Hi sravya ,



  There is a out of box notification "SLA breached" which will fire when SLA   is more than 100% please   inactive the notification the notification   is on Task SLA table


find_real_file.png




Thanks & Regards


Anvesh


View solution in original post

13 REPLIES 13

Hi,


this is BR on task_sla table:



assignWorkflow();




function assignWorkflow() {


    if (!current.sla.workflow.nil())


          startWorkflow(current.sla.workflow.toString());


}




function startWorkflow(id) {


    // is this a retroactive start?


    var msecs = new GlideDateTime().getNumericValue() - current.start_time.getGlideObject().getNumericValue();


   


    // treat this as a retroactive workflow start if the SLA started more than 5 seconds ago


    var w = new Workflow();


    if (msecs <= 5000)


          w.startFlow(id, current, current.operation());


    else


          w.startFlowRetroactive(id, msecs, current, current.operation());




    // update the record in case the workflow changed some values


    current.update();


}



here you can see current.update() is there . i think this is what causing the workflow to get triggered for multiple times


anvesh_v
Giga Guru

Hi sravya ,



  There is a out of box notification "SLA breached" which will fire when SLA   is more than 100% please   inactive the notification the notification   is on Task SLA table


find_real_file.png




Thanks & Regards


Anvesh


Hi Anvesh,



I don't think this notification is causing the notifications being sent after 100 % because I checked and i found that the notification subject is not same as this notification (SLA breached).


Are you getting 25,50,75% mails too or are they being skipped?



Can you give us a screenshot of your workflow with the SLA Percentage timer activity?


yes im getting 25,50,75 percent as well


PFB the screenshot of workflow:



find_real_file.png