Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Case submitted via CSM Portal should not close on Weekend and State holidays

EktaK
Tera Contributor

Hi all,

 

I have requirement in which Case submitted from CSM Portal should not be auto-close on weekend and State holidays for Specific Account.
Currently we have flow Which is running to auto close the case. 
For now as I have created a Schedule in [cmn_schedule] table and added all holidays in schedule Entries.

But i am not able to call this schedule Entries in Flow, so that i can skip these weekend and holidays.

 

Is there anyway I can resolve this issue.

 

TIA.

2 REPLIES 2

Diogo Ramos
Tera Sage

Hello

You need to give us more details about your flow, how is it triggered ? What is in it?

Normally if you use wait conditions, you can specify which schedule it uses, similar to how the SLAs flow runs. You should normally be able to say wait a specific amount of time counting within the schedule only.

Diogo

Vishal Jaswal
Tera Sage

Hello @EktaK 

If your Flow only runs on weekdays to look up records (sn_customerservice_case) resolved x days ago, then every such case resolved will be closed only on weekdays.

Unfortunately, as of today ServiceNow scheduled trigger condition doesn't support to run flow on weekdays. (you should submit an idea). Hence, your flow need to have flow variable to determine the day of the week and taking that value, you can have if else condition to end flow else close the record as shown below:

VishalJaswal_0-1790279958284.png

VishalJaswal_0-1790280090570.png

 

VishalJaswal_2-1790279999602.png

var gdt = new GlideDateTime();
// return gdt.getDayOfWeek();  // Use getDayOfWeek() for global applications (1 = Monday, 7 = Sunday)
return gdt.getDayOfWeekUTC();  // Use getDayOfWeekUTC() for scoped applications (1 = Monday, 7 = Sunday)

Hope that helps!