Two Duplicate SLA defintions on a single catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hello Community,
I have configured a SLA condition rule for a SLA definition on the sc_task table. I configured the attach() function and it started the SLA task on sc_task record. But it is having duplicates of the same SLA Definitions on the sc_task record. They are created 2 seconds apart. Any help will be greatly appreciated.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hi @shahiedsali ,
Wrap it so it only fires if there isn't already an active (or any) task_sla for that definition on that task and never call attach() unconditionally. Please check the below example :
(function() {
var slaDefSysId = 'PUT_YOUR_SLA_DEFINITION_SYS_ID_HERE';
var gr = new GlideRecord('task_sla');
gr.addQuery('task', current.sys_id);
gr.addQuery('sla', slaDefSysId);
gr.query();
if (!gr.hasNext()) {
attach();
}
})();
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hi @shahiedsali
Chandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Hi @shahiedsali
- Use distinct conditions (Like assignment group etc) for each definition. Verify that "Allow Multiple" is unchecked if you only want one instance of a specific definition on a task
Add current.setWorkflow(false); in your custom Business Rule or script prior to updating the sc_task record. This prevents the standard "Run SLAs" Business Rule from simultaneously firing
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @shahiedsali
Can you please share how your configuration ?
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/