- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2025 07:28 AM
If date is past then status will show deployed otherwise it show inprogress in servicenow
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 01:30 AM - edited ‎02-06-2025 01:31 AM
Hi @gy891815
Not clear with you requirement, but you can try following imaginary script in your BR:
(function executeRule(current, previous /*null when async*/) {
var currentDate = new GlideDateTime();
var incidentDate = current.Name_of_date_field;
if (incidentDate <= currentDate) {
current.incident_status = 'Deployed';
} else {
current.incident_status = 'In Progress';
}
current.setWorkflow(false);
current.update();
current.setWorkflow(true);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 01:10 AM
Can you please elaborate your question so we can guide you properly?
If possible do share what you have done so far? Where are you block in this case?
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 01:20 AM
Are you talking about creating a job or something which checks if the date is in past then update the status?
If yes then where are you stuck?
If not then please share complete details i.e. what's your business requirement along with screenshots.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 01:25 AM
Hi @gy891815
Why are you creating a duplicate issue?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 01:30 AM - edited ‎02-06-2025 01:31 AM
Hi @gy891815
Not clear with you requirement, but you can try following imaginary script in your BR:
(function executeRule(current, previous /*null when async*/) {
var currentDate = new GlideDateTime();
var incidentDate = current.Name_of_date_field;
if (incidentDate <= currentDate) {
current.incident_status = 'Deployed';
} else {
current.incident_status = 'In Progress';
}
current.setWorkflow(false);
current.update();
current.setWorkflow(true);
})(current, previous);