- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 05:01 AM
I have a field on incident form named "follow up" this is a date and time field.
I am creating on schedule job to perform the required action. which will run every morning 7 am..
As per the requirement if current date is greater then the date entered in the field "follow up" then it should change the incident state to "in progress".
Could anyone please help me with the script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 05:19 AM
Hi @VIKAS MISHRA ,
Please try below code -
var currDate = gs.now();
var followDate = inc.u_follow_up; // Replace it with the correct object and field name
if(currDate > followDate) {
inc.state = '2'; // Replace it with correct object, field name and value
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 05:19 AM
Hi @VIKAS MISHRA ,
Please try below code -
var currDate = gs.now();
var followDate = inc.u_follow_up; // Replace it with the correct object and field name
if(currDate > followDate) {
inc.state = '2'; // Replace it with correct object, field name and value
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 05:29 AM
Hi,
Try below code in scheduled job.