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

6 REPLIES 6

Tanushree Maiti
Kilo Patron

Hi @jugantanaya 

 

From Incident to REQ:

 

Step1 : Update Create Request UI action script . There is 2 UI action with same name. Make sure you are updating correct one.

OOB code :

current.update();
var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
else {
url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}


Customized Code:

current.update();
var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id + '&sysparm_region=' + current.u_region;
}
else {
url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id + '&sysparm_region=' + current.u_region;
}

 

Step2: On the specific Catalog Item, create an onLoad() script to pull that value into a variable.

Sample script: 
function onLoad() {
    var url = top.location.href;
    var region = new URLSearchParams(url).get('sysparm_region');
    if (region) {
        g_form.setValue('req_region', region); // 'req_region' is your variable name    }
}

 

From Req to RITM, SCTASK : 

Dot Walking

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Ankur Bawiskar
Tera Patron

@jugantanaya 

you can use the flow which is triggering on that catalog item to update the REQ,RITM with that INC Region

This will ensure you follow low-code, no-code approach

The REQ will have INC as it's parent so that's how you can grab the INC

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader