To add a Service Level Agreement (SLA) to a Service Catalog Task (sc_task) in ServiceNow using Flow Designer, you need to understand that ServiceNow's SLAs are typically managed by the SLA Engine, which operates based on SLA Definitions. These definitions include conditions that trigger SLA starts, pauses, completes, and breaches.
SLA Definitions should already be set up in your instance if you want to attach SLAs to records automatically. The process includes creating an SLA Definition record (from the sla table) that specifies the conditions under which the SLA should be applied to a sc_task or other kinds of tasks.
Here are the steps to ensure that your Service Catalog Tasks have SLAs attached and the general approach to interact with SLAs in Flow Designer:
-
SLA Definition Setup: Go to the SLA Definitions module and ensure there's an SLA Definition configured for your Service Catalog Tasks. When creating the definition, use the 'Applies to' field to link it to the sc_task table, and set the conditions under which this SLA should start, stop, pause, and reset.
-
Configure SLA Trigger: In the SLA Definition, you'll specify the start condition, such as when a sc_task is created or when its state changes to a certain value. When the condition is met, the SLA Engine automatically attaches the SLA to the corresponding sc_task record.
-
Flow Designer (Optional): If you absolutely need to use Flow Designer to work with SLAs, which is not common because the SLA engine handles this automatically, you could use a "Script Step" in your flow to manipulate SLA records programmatically. However, I would advise against manually creating SLA records unless you have very specific customization needs that fall outside of the SLA Engine's capabilities.
-
Verify SLA Attachment: After setting up the SLA Definitions, create or update a sc_task to meet the start condition of an SLA, and verify that the SLA is attached correctly to the task.
If you find that you need (for some custom process) to specifically interact with SLAs in Flow Designer, you'll likely resort to custom scripting, since there are no dedicated out-of-the-box Flow Designer actions for managing SLAs. This is more advanced and typically not necessary for standard SLA operations in ServiceNow.
In conclusion, ensure your SLA Definitions are properly configured, and the system will handle attaching SLAs to sc_task records without the need for custom flows. Only use Flow Designer for SLA manipulation if there's a compelling reason to do so, and if you do, ensure that you are comfortable with custom scripting within ServiceNow.