Create New Incident from URL with prefilled form Fields

danalbrecht
Kilo Contributor

Hello.   I am very new to using ServiceNow and we are looking for a way to create a new incident with some prefilled information located in the Summary and description fields.

I have the starting url that needs to be added to:

https://xxxx.service-now.com/cna/create_incident.do

But I am not sure how to construct the remaining portion of the url to get this to work.

I have inspected the elements on the page and have the ID of the fields I would like to populate but no matter what I try, it does not seem to be working.   Any guidance you can get for this newbie would be extremely helpful.

Field ID's: u_incident_ess.u_summary

u_incident_ess.u_description

We are trying to integrate Salesforce, Guidewire, and other application platforms to be able to use a simple URL creation to create incidents with important information from the integrated systems to allow for better support.   We realize that this could be done through some web service integrations however we feel this might be a better solution to meet our needs.

Thanks

26 REPLIES 26

Mohd1
Mega Contributor

I need help with a similar problem. I am trying to launch create new incident by passing location in the url parameter but unable to do so because of following issues-

1. The location is a reference field, it does not accept string values as a param but accepts sys_id of location. I want to pass the location name in the paramater

2. If i pass the sys_id of the location, the form populates it for a second and then overrides it with user location. How to stop this behavior of the create incident form.

Mohd1
Mega Contributor

I need help with a similar problem. I am trying to launch create new incident by passing location in the url parameter but unable to do so because of following issues-

1. The location is a reference field, it does not accept string values as a param but accepts sys_id of location. I want to pass the location name in the parameter.

2. If i pass the sys_id of the location, the form populates it for a second and then overrides it with user location. How to stop this behavior of the create incident form.

If the location is being changed after the form is loaded, it is most likely a client script doing the work. Check the client scripts on incident (and possibly task) tables to see if there are any setting the location. I recall there was one that sets it onLoad so there's a default location.

If you deactivate that client script, the location field will be empty for everyone else, but it will allow you to set the default from the URL.

Thank you Chuck. As you said, it was due to a client script.

I still have an open issue on how to pass a value in url parameter for a referenced filed like location in incident table. Passing a sys id works but other attributes like name doesn't. I think writing a client script to query the location table based on the name passed as a parameter might work. Any other possible solution. Appreciate the help.

When you need to get information that is not part of the present form (e.g. dot-walking) the best practice is a GlideAjax operation. You can find examples of this in episodes 5, 6, and 33 of TechNow. Here's some additional documentation.

Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax  
Developer: Client Scripting Technical Best Practices Overview