From the Service Portal record producer form to populate Incident for with "Impact"

Roshni1
Tera Expert

I currently have a form on our SP that captures the new incidents.  Users are to identify the "Impact" and "Urgency" of thier incident which then is added to the Incident form and will set the priorty.  

At this time only the "Urgency" is getting populated after a users submits the form. Is there something wrong with my coding or is there a better way 

 

This is the code I currently have: 

current.setValue('contact_type', 'self-service');
gs.addInfoMessage(producer.getDisplayValue('impacted_user'));
current.setValue('caller_id',producer.getValue('impacted_user'));
current.setValue('contact_type', 'self-service');
//current.setValue('short_description', 'Issue: ' + producer.getDisplayValue('issue_related_to') +   (producer.getValue('issue') ? ' - ' + producer.getDisplayValue('issue') : ''));
current.setValue('u_preferred_method_of_contact', producer.getValue('preferred_method_of_contact'));
if(producer.getValue('alternate_contact_information')) {
    current.setValue('u_alternate_contact_information', producer.getValue('alternate_contact_information'));
}
current.setValue('impact', producer.getValue('impact'));
current.setValue('urgency', producer.getValue('urgency'));
 
Thanks very much for your continued support. 
1 ACCEPTED SOLUTION

Deepak Negi
Mega Sage
Mega Sage

There are easier ways to copy the variables from producer to the target record without any script.

 

1. If you keep the variable names same as Incident field name, it will automatically copy from record producer

e.g keep the Impact variable name as 'impact'

 

2. Use "Map to field" on the record producer form

DeepakNegi_0-1754624242513.png

 

 

Please mark the answer helpful or correct if it helps

 

Thanks
Deepak

View solution in original post

6 REPLIES 6

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Roshni1 

 

There’s no need to write a lengthy piece of code — the solution provided by @Deepak Negi Deepak works perfectly fine and will resolve the issue.

However, my concern isn't about the mapping itself, but rather the process behind it.

From a process perspective, for any user, their incident will always seem like a Priority 1. By allowing users to select both Impact and Urgency in the record producer, you may run into issues. If every user starts selecting Impact 1 and Urgency 1, it will result in a Priority 1 incident — and P1 SLAs are always tight.

So, I suggest revisiting this requirement. Consider whether it's necessary to show both Impact and Urgency to the end user, or if only Urgency should be shown instead.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Thats right

 

Ideally Urgency should be the appropriate field to be available on the request form