Create Incident from requested item

amaneet
Kilo Contributor

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.

https://www.servicenowguru.com/scripting/client-scripts-scripting/parse-url-parameters-client-script...

Any ideas please?

10 REPLIES 10

The parameter name should start with "sysparm_" if you want to read it via URL.


Can you change the parameter name to "sysparm_ritm" instead of "ritm".



Thant should resolve the issue for you.


Used sysparm_ritm only intially. But at times it works and sometimes it


does not.




On Tue, 23 Jan 2018 at 10:18 AM, mayank.agarwal <


Hi Amaneet,



I am not sure about this behavior, it was working fine for me whenever i used it.



If you are facing issues, I would suggest to try and fetch information from document.referrer in onLoad client scipt.



document.referrer will let you know what link or previous page you are coming to new page ( from what page you are redirected )


If you get hold of previous page, you can then parse the URI information.



In my onLoad script, I would try something like



function onLoad() {



var referringURL = document.referrer;


alert(referrringURL);



/*


        Do parsing here


*/


}


On Tue, 23 Jan 2018 at 11:34 AM, deepak.ingale <


Hi Amaneet,



Did it worked for you?