Group Assignment based on Schedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 05:33 AM
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 06:02 AM
Hi @Swapnilc191 ,
You can create one flow one that you can configure like below.
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 06:17 AM
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