Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Set Value in RITM based on variable change by catalog client script

chaitanyakumar
Tera Expert

Hi Guys,

I am trying to update the worknotes in RITM record when few of the variables on RITM record are changed. Since i have already have catalog client script on the variables and i would like to take advantage of that. So i thought i can do by script include and call the script include in catalog client script but i couldn't able to figure out the way to get the RITM record based on variables in script include. I don't want to run the business rules because i only want to run the script when variables changes so i thought catalog client script is the best option.

Can someone help me with this.

Thanks,

Chaitanya

5 REPLIES 5

rahulpandey
Kilo Sage

Hi Chaitanya,

g_form.getUniqueValue() will return you the sys_id of ritm at client side and then you can pass this as a parameter to script include.

g_form.getUniqueValue() is returns the Catalog Item ( Maintain Item) sys id but i need the RITM sys id so that i can query the sc_req_item table update the RITM record

Hi Chaitanya,

It returns the RITM sys_id, just check "Applies on Requested Items"

Refer below screenshot

find_real_file.png

Below is the catalog client script

find_real_file.png

Thanks Rahul. But i have checked applies on catalog item , I can't uncheck that. I have find other way to find the RITM record based on User variable in my catalog item