Stop SLA when additional comment entered

Chris77
Kilo Guru

Hey folks, 

So I have been working on creating an SLA for a specified group that closes out when a user enters an additional comment on the work notes. I am not allowed to create new fields on the incident table (so creating a true/false field then having a business rule trigger it is out of the question). I created a script include that extends slaconditionbase and created a new SLA condition to reference that script. I am able to add some script to have the sla complete when additional comments are entered. Now the only problem is once the sla completes (because a comment was entered) It keeps reattaching once they assign it to a different user in the group. I need the incident to just complete and not reattach unless the incident leaves the group and then comes back to the group. I have adding some script in the script includes basically telling it not to attach if the sla has already completed. However, it seems this is not working. Any help would be appreciated. I also tried adding script to just have it leave the script include once the complete function returns true. However, as soon as the incident gets reassigned or gets unassigned (but stays in the group) it will reattach. Thank you all for your time.

1 ACCEPTED SOLUTION

Chris77
Kilo Guru

Thanks again for all the responses. I was able to figure it out finally. I went ahead and created a new script include that extends the SLAConditionBase class. I then created a new SLAConditionType that referenced that Script Include and just added some script to the attach: function() and the complete: function(). The documentation that led me to go about this route is located at  https://docs.servicenow.com/bundle/madrid-it-service-management/page/product/service-level-managemen... (in the event someone in the future has the same task they are trying to complete. Thanks again for everyone's input.

View solution in original post

8 REPLIES 8

Tommy SN Sahlin
Kilo Sage

Hi Chris,

how about if you have the Task SLA pause instead of completing, then set it to Complete when the Incident closes? In other words, more or less move your Stop Conditions into Pause Conditions. That way, the paused Task SLA will prevent any new Task SLAs to be created (based on the same SLA Definition).

cheers, hope that helps  /Tommy

Ct111
Giga Sage

See you have to careful about the triggering condition I mean the one you have configured under Start

and Stop section, so let's keep it simple, when you want SLA to trigger when the assignment group changes ,so put that in start and to stop if additional comment changes , so put only that condition in stop

you will be complicating the stuff if you keep changing the condition and it will add other SLA also.

 

 

Mark my ANSWER as CORRECT and HELPFUL if it helps

 

The issue is that once the Task SLA is completed, it opens up the possibility for a new one to be created, based on the Start condition, potentially leaving you with several Task SLAs. This is what you avoid by leaving the Task SLA in pause condition. Perfectly simple and quite standard 😊

 

cheers  /Tommy

Chris77
Kilo Guru

Thank you all for your quick responses. I thought about the pause idea. The only issue with that was that if a response is made (comment). The SLA will stop (pause) However, there is a chance the assignment group could still change after they leave a comment. Which will cancel out the the closed completed SLA.