Create Incident from requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 08:36 AM
Hi Folks,
We have a requirement to create an incident from requested item. Our approach is to give a UI action on sc_req_item_table and then create an incident via a record producer.
We are facing a trouble to pass the parameters via url to client script. We will use this parameters in on load client script and then play around with that value.
Have gone through the following link, but nav.do is playing spoilsport.
Any ideas please?
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 08:40 AM
3 Ways to Populate Values in ServiceNow via the URL
This is what I refer to whenever I require to pass information using parameters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 08:51 AM
I am using option 2 of that, but the null value is passed in parameter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 08:56 AM
Hi Amaneet,
Could you please share code of your UI action and onLoad catalog client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 06:40 PM
Hi Deepak,
here is the code:
UI action
current.update();
var url='com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=ce3c5fbddb3f030055d7712ebf9619cc&ritm='+current.sys_id;
action.setRedirectURL(url);
Catalog client script
function onLoad() {
//Type appropriate comment here, and begin script below
var IDval = getParmVal('ritm');
g_form.addInfoMessage(IDval);
g_form.setValue('short_description',IDval);
function getParmVal(name){
var url = document.URL.parseQuery();
if(url[name]){
return decodeURI(url[name]);
}
else{
return;
}
}
}