Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Script Include in Condition Builder for SLA defintion

shahiedsali
Tera Expert

Hello Community,

I am trying to use a Script Include in a SLA Definition's condition builder for the sc_task table. It was working alright but as soon as I made the change to include 'current' in the function, it seems like it is not calling the Script Include at all. The use-case requires to match the current sc_task's record to a record in another table 😭. Any help is greatly appreciated.

 

Working: javascript: new global.exampleCheckUtils().getMatchingShortDescription()

Not working: javascript: new global.exampleCheckUtils().getMatchingShortDescription(current)

3 REPLIES 3

Tanushree Maiti
Tera Patron

Hi @shahiedsali 

 

Can you confirm whether

 

Glide AJAX enabled  box is checked in your Script include exampleCheckUtils  //if you are using Australia
TanushreeMaiti_1-1789910082593.png

 

OR
Client callable enabled  box is checked in your Script include exampleCheckUtils  //if you are using any lower servicenow version other than Australia
TanushreeMaiti_0-1789910016694.png

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

shahiedsali
Tera Expert

Hello @Tanushree Maiti,

 

Yes I have checked the Glide AJAX enabled, it is working without the 'current' argument in the function. Once I added the argument, it does not call or fire off the Script Include.

shahiedsali_0-1789911162323.png

shahiedsali_1-1789911261135.png

 



 

Kieran Anson
Kilo Patron

Hi,

current won't be accessible in the condition builder. If the decision process is more complex than what the condition builder provides then you need to leverage SLA condition rules. This provides a mechanism to use a script include that extends a base script include. Within this, you can call custom code to evaluate each condition criteria

 

https://www.servicenow.com/docs/r/it-service-management/service-level-management/c_SLAConditionRules...