How to have the priority set on the CASE form against Alert's Severity.

Jae1
Giga Contributor
I am working with a customer that has integrated Customer Service Management with Event management.
They would like to have the priority set on the CASE form against Alert's Severity.
for example, If an alert severity is Major, the priority has to be High (2) on Case.

Customer is using 'Case Creation on Alert', which is OOTB action in flow designer for automating case creation against alert.
I found editable script for the Priority field value in the 'action' (flow designer) as below
Can anyone please advise if the below script is good enough or need to modify to meet their requirement


var priority = 4;// default Low.
var extensions = new GlideScriptedExtensionPoint().getExtensions('CasePriorityMapper');
if(extensions.length > 0){
priority = extensions[extensions.length-1].getPriority(fd_data.action_inputs.alertgr.sys_id);
}
return priority;
1 ACCEPTED SOLUTION

Vivek Verma
Mega Sage
Mega Sage

Hey Jae,

Let me explain the process step by step. 

1. Create your own Class Script Include. For ref https://dev72123.service-now.com/sys_script_include.do?sys_id=9bc4f679731a73008b516cb63cf6a7d8&syspa...

2. Create Extension Instance (Table: sys_extension_instance). For ref https://dev72123.service-now.com/sys_extension_instance.do?sys_id=97c47a79731a73008b516cb63cf6a72c&s...

Note: The extension instance with the highest order number would be used.

 

*Please replace the instance base URL with your own.

 

find_real_file.pngPlease mark this as answered if this resolves your query. 

View solution in original post

3 REPLIES 3

Vivek Verma
Mega Sage
Mega Sage

Check this Script Include:

 

find_real_file.png

Link:    /sys_script_include.do%3Fsys_id%3D9bc4f679731a73008b516cb63cf6a7d8%26sysparm_record_target%3Dsys_script_include%26sysparm_record_row%3D1%26sysparm_record_rows%3D1%26sysparm_record_list%3DnameSTARTSWITHCasePriorityMapper%255EORDERBYname

 

as this script include is protected. You need to understand the Extenstion point logic to add your customer-defined priority. 

 

Please check this article: https://codecreative.io/blog/are-extension-points-worth-it/

 

Thanks,

Vivek

Vivek Verma
Mega Sage
Mega Sage

check Extention point: sys_extension_point.do?sys_id=38943679731a73008b516cb63cf6a751&sysparm_record_target=sys_metadata&sysparm_record_row=79&sysparm_record_rows=241&sysparm_record_list=sys_scope%3Dfe305c5477122300d7159b71a9106101%5EORDERBYsys_class_name

 

Extension Instance: sys_extension_instance.do?sys_id=97c47a79731a73008b516cb63cf6a72c&sysparm_record_target=sys_metadata&sysparm_record_row=78&sysparm_record_rows=241&sysparm_record_list=sys_scope%3Dfe305c5477122300d7159b71a9106101%5EORDERBYsys_class_name

Vivek Verma
Mega Sage
Mega Sage

Hey Jae,

Let me explain the process step by step. 

1. Create your own Class Script Include. For ref https://dev72123.service-now.com/sys_script_include.do?sys_id=9bc4f679731a73008b516cb63cf6a7d8&syspa...

2. Create Extension Instance (Table: sys_extension_instance). For ref https://dev72123.service-now.com/sys_extension_instance.do?sys_id=97c47a79731a73008b516cb63cf6a72c&s...

Note: The extension instance with the highest order number would be used.

 

*Please replace the instance base URL with your own.

 

find_real_file.pngPlease mark this as answered if this resolves your query.