How do I set a Task SLA in Flow designer

rafas_2703
Tera Guru

Hi there guys!

 

I have a flow and in that flow I have a get Catalog Variables action.

From the different question choices on a variable I have different assignment groups/ Task SLA's that I want the HR Case to have.

 

The assignment group part is already done and working, but I can't set the SLA in the flow for different choices.

Any ideias?

 

Thanks,

Sérgio

6 REPLIES 6

JP - Kyndryl
Kilo Sage

Hi Sérgio,

I would set this in the SLA definitions since you are able to configure them using the catalog variables.

Here is an example:

https://www.servicenow.com/community/developer-forum/how-to-start-sla-based-on-value-of-variable-in-...

 

Regards,
JP

Hi JP,

I see, but I can't find 'variable' in the condition. Keep in mind the table is sn_hr_core_case. It still should appear?

SANDEEP28
Mega Sage

@rafas_2703 You can use condition builder of SLA definition to set SLA based on variables. But it will be hard to maintain if you have few complex condition or same SLA definition you would need to use for other type of HR cases.

 

So I found out a way where you can achieve this in flow designer itself. Follow below steps

 

1) Create flow variable called as "Set SLA" of type True/False as below

 

SANDEEP28_0-1689684769944.png

 

2) You won't be able to add SLA to record while updating record. So, you need add one more flow logic called as "Set flow variables" (This available under flow logic) and add below script into it

 

var grSetSLA = new GlideRecord('task_sla');
grSetSLA.sla = 'f29232209f22120047a2d126c42e70f9'; // sys id of SLA definition which you created
grSetSLA.task = fd_data.trigger.table_name.sys_id; // sys of a HR case
if (grSetSLA.insert())
return true;
 
SANDEEP28_1-1689684931108.png

 

 

 

 

SANDEEP28_2-1689684968711.png

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

Should I replace 'grSetSLA.task = fd_data.trigger.table_name.sys_id;' with sn_hr_core_case table and the respective sys_id of the table?