How to copy Region field from incident to REQ & RITM & SC Task.

jugantanaya
Tera Contributor

Hi,

If a request created from an Incident how i can copy region field to REQ & then RITM & then SC Task?

 

 

jugantanaya_0-1776362926548.png

Thanks in advance.

 

Regards,

Juganta

1 REPLY 1

AlpUtkuM
Mega Sage

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);