How to Calculate SLA based on two Date and Time fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 10:02 PM
Dear all,
I have 2 custom date fields in my incident form: "Start Time" and "End Time".
I'd like to calculate SLA times based on these 2 date fields. There is a possibility that those two dates can come together. ServiceNow gives the possibility to set a 'retroactive' start time setting it to a specific field ("Set start to" field in SLA definition form).
I am facing the issue in stopping the SLA based on the value in "End Time" field. Business Elapsed Time is not calculating based on "Start Time" and "End Time".
How to calculate SLA based on values in these 2 fields rather than the sys_created or sys_updated fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 10:22 PM
• SLA calculation requires two date and time fields to be present in a record.
• The difference between the two fields is used to calculate the SLA.
• The difference between the two fields can be calculated using the g_form.getDuration() method.
• The SLA value can be calculated using the getSLADueDate() method.
• The SLA value can be displayed on the form using the g_form.addInfoMessage() method.
For asking ServiceNow-related questions try this :
For a good and optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 10:47 PM
Hi Sourav,
Thanks for response. I wonder this way the we can show the SLA on form level.
I wanted to know how if there is possibility to do this calculation in the standard task_sla table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 11:00 PM
Hi @sathya23 ,
Why would you create two new fields for SLA calculation instead of utilizing the actual SLA definition which is OOTB in ServiceNow?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2023 11:38 PM
Hi Anders,
Thanks for response, I am utilizing OOO SLA definition, actually the use case is to calculate the SLA based on Date/Time values in respective fields Let say (Start-date/time and End-date/time)not based on the SLA Start Condition and Stop Condition.
For SLA start I see there is an option Retroactive Start, but there is no Retroactive Stop option.