Create an SLA based off a variable date entered after request creation

nhenderson
Tera Contributor

I am trying to find a way to create a custom SLA based off of the field my resource fills in after checking with the person who requested the work.

Scenario:
Our Servers team is requested to build a specific server setup for a project coming. It will not be accomplished within our normal base SLA. 

The resource follows up with the person who requested the work, they agree on a delivery date. I want the resource to be able to go back to the request, change the "Agreed Date" variable and that trigger a new SLA based off of the date selected.

I've created the SLA definition in my dev environment and the business rule with my script.

nhenderson_1-1743517958161.png

 

nhenderson_2-1743518027461.png


But I feel I am missing something in connecting them and triggering the SLA change.

 

2 REPLIES 2

Shivalika
Mega Sage

Hello @nhenderson 

 

Instead of start condition as state is not open , give it "State IS-ONE-OF" 

 

You haven't given any pause and stop conditions ? Not giving pause is fine but stop ? 

 

Please make these minor changes and let me know the updates. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

 

Ankur Bawiskar
Tera Patron
Tera Patron

@nhenderson 

so you want SLA to start when the Agreed date reaches?

Consider SC Task created on today and Agreed date is 5th March.

If yes then did you try giving this in Start Condition. See if that works
variables -> Agreed Date [ON] Today

OR

If the above doesn't work then try this

1. Create a custom Date field on the sc_task table.
2. Create a before insert business rule that sets the Date field to date with the Agreed date.

BR will run only when it's for your catalog item

current.request_item.cat_item.name == 'Your Item Name'

Script:

var ritm  = current.request_item.getRefRecord();
current.u_my_field = new GlideDateTime(ritm.variables.u_agreed_date).getDate;

3. In your SLA start condition add this My Field [ON] Today

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader