- 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 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 02:16 AM
Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 12:55 AM
What will be the When to run condition? I'm writing the above code at change task table with before Insert and Update when Change request field is not empty.
Not working for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-31-2024 09:42 PM
Can you share the complete details that how can we achieve it.
Thanks in advance.