- 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-12-2022 07:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 09:00 AM
Hi Zuri!
Can you share the exact code you set in the business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 05:38 PM

- 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-13-2022 10:31 AM
Thank you