- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2022 03:31 PM
I want to copy information from change request when new change task is added.
change configuration item
Change task I want the field to auto populate information from change request
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:12 AM
Hi Zuri!
I think I did a mistake there!
I pointed you to sc_task table and not the change_task table!
Your code should be something like:
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.sys_id);
gr.query();
while(gr.next()){
gr.planned_start_date = current.getValue("start_date");
gr.planned_end_date = current.getValue("end_date");
gr.update();
}
Only use the gr.update() if your business rule is executing AFTER update. If it is Before update remove the gr.update().
Hope this helps!!
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Best Regards,
Filipe Cruz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:01 PM
1. I wanted the change task to populate planned start date and planned end date based on what I have in change request. That is successful.
2.Now I want to update the record when change request being updated with new start date and end date. Currently it only populate the date in new change task but if user change the start date and end date is not updating the catalog task with new dates

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 04:10 PM
Hi Zuri,
So you want to update the catalog task with data from the change_request, right?
Do you have a reference to the catalog task in the change request ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 07:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 12:19 AM
Hi Zuri,
In that case you need to update the catalog task in the following way:
1) create a BR in the change_request table that will execute the following code:
var gr = new GlideRecord("sc_task");
gr.addQuery("change_task", current.sys_id);
gr.addQuery("active", true);
gr.query();
while(gr.next()){
gr.start_date = current.planned_start_date;
gr.end_date = current.planned_end_date;
gr.update();
}
Please review the field names since I'm not sure about them!
Give me feedback about this solution.
Please mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Best Regards,
Filipe Cruz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 07:18 AM
I did after business rule on change request to run when start date or end date changes. I added the query above in script but is not updating.
planned_start_date field in change task table is equal to start_date field in change request table.