- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 12:58 AM
I have only tried this,
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("change_task");
gr.initialize();
gr.change_request = current.sys_id;
gr.insert();
gs.addInfoMessage(gr.number+"",'Change task has been created ');
})(current, previous);
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 01:45 AM
Hello kartik,
That code works for the creation of the change_task.
For the update you can do a similar code:
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.sys_id);
gr.query();
while(gr.next()){
gr.field = current.field;
gr.update();
}
})(current, previous);
Please update the line gr.field = current.field to use the right fields that you want to 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-22-2022 01:45 AM
Hello kartik,
That code works for the creation of the change_task.
For the update you can do a similar code:
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("change_task");
gr.addQuery("change_request", current.sys_id);
gr.query();
while(gr.next()){
gr.field = current.field;
gr.update();
}
})(current, previous);
Please update the line gr.field = current.field to use the right fields that you want to 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-22-2022 04:10 AM
Thank You