- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 12:33 AM
Create Change Request and then Click Change Tasks -> New.
How to copy Planned start date and Planned end date from Change Request to Change Task when state is New record?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 01:10 AM
You could write a before Business Rule, however, the record hasn't been created yet, so those fields won't be populated until you click submit.
I'd suggest using a display business rule to do the job with the following code:
(function executeRule(current, previous /*null when async*/) {
var parentChange = current.change_request.getRefRecord();
if (parentChange.isValidRecord()) {
current.planned_start_date = parentChange.start_date;
current.planned_end_date = parentChange.end_date;
}
})(current, previous);
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 12:46 AM
Hi
Write a before business Rule on change_task
Check only on Insert
In the script add the below code
current.planned_start_date= parent.planned_start_date;
current.planned_end_date= parent.planned_end_date;
current.update();
Try this and let me know if you any issues with it
Regards
Ravi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 02:15 AM
Thank you very much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 12:53 AM
i would not recommend here to use "current.update()" in business rule.
Business Rule: create before business rule on change_task table and mark "Insert" check box as true.
try with below script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sdt = current.change_request.start_date;
var edt = current.change_request.end_date;
current.planned_start_date=sdt;
current.planned_end_date=edt;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 02:15 AM
Thank you very much.