- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 02:53 AM - edited 01-28-2025 02:57 AM
hello dear community,
im trying to create a BR which will trigger when the start or end date of a change changes.
It then should fill the start and/or end date of the related change task(s).
It seemed at first like a quick fix but for some reason the BR wont trigger. I have tried to use a script and the script debugger but although i trigger it, the BR isnt running. I have tried to change the order and the "when" but nothing seems to help.
Its the same in my PDI, i think there is something i miss.
For help and suggestions i will be very grateful,
Solved! Go to Solution.
- Labels:
-
Data Foundations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:18 AM
you can use flow or you can use after update BR on change_request table
Condition: Start Date Changes OR End Date Changes
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.getUniqueValue());
gr.query();
while (gr.next()) {
gr.planned_start_date = current.start_date;
gr.planned_end_date = current.end_date;
gr.update();
}
})(current, previous);
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
01-28-2025 04:07 AM - edited 01-28-2025 04:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2025 04:18 AM
you can use flow or you can use after update BR on change_request table
Condition: Start Date Changes OR End Date Changes
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.getUniqueValue());
gr.query();
while (gr.next()) {
gr.planned_start_date = current.start_date;
gr.planned_end_date = current.end_date;
gr.update();
}
})(current, previous);
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
01-28-2025 04:27 AM
thank you a lot for the help, its now working!