The CreatorCon Call for Content is officially open! Get started here.

Group Assignment based on Schedule

Swapnilc191
Tera Contributor

Hi,

I have a date type variable called 'start_Date' on catalog - which helps me create RITM. Initially and till the RITM is processed, the assignment group is 'HR'. At the end of flow, the assignment group changes from 'HR' to 'Level1'.

I want the assignment group to change from ‘’HR’’ to ‘’Desk’’ only when current date is greater than start date + 49 days.

current.date > (start_date + 49 days)

How to do this ?

2 REPLIES 2

Runjay Patel
Giga Sage

Hi @Swapnilc191 ,

 

You can create one flow one that you can configure like below.

RunjayPatel_0-1730293244198.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

Moin Kazi
Kilo Sage
Kilo Sage

Hi @Swapnilc191 ,

 

You can use the script below to validate the date logic and update the assignment group.

Please modify it according to your requirements it just an example:

// Assume userStartDate is the date provided by the user in the appropriate format
var userStartDate = new GlideDateTime(input.user_start_date); // Replace 'user_start_date' with the actual field name
// Add 49 days to the user's start date
userStartDate.addDays(49);
// Get the current date
var currentDate = new GlideDateTime();
// Compare the two dates
if (userStartDate < currentDate) {
    // The current date is after the user's start date plus 49 days
    // Add your logic here and change assignment group to Desk
} 

If you want this logic to be used in a flow, please create a new action that includes a script and accepts two inputs: the start date and the assignment group.

 

Hope this help you.

 

Regards

Moin