How to copy Region field from incident to REQ & RITM & SC Task.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi,
If a request created from an Incident how i can copy region field to REQ & then RITM & then SC Task?
Thanks in advance.
Regards,
Juganta
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
50m ago
If I would be you, I would only create one more additional region field on RITM or SCTASK form. It would not make sense to create same field for every form. I would create an after Business Rule on Incident table. Business rule should run on Insert. Try below code on BR
// Example code to copy region field from Incident to SCTASK
(function executeRule(current, previous /*null when async*/) {
var task = new GlideRecord('sc_task');
task.addQuery('parent', current.sys_id);
task.query();
while (task.next()) {
task.region = current.region;
task.update();
}
})(current, previous);
