Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Create Change UI Action query

Cirrus
Kilo Sage

Hi,

We would like to create a change from a catalog task, and can achieve this simply by using the following script in a ui action:

var url = new GlideURL("change_request.do");
url.set("sys_id" , "-1");
url.set("sysparm_query" , "^parent=" + current.sys_id);
action.setRedirectURL(url.toString()+"");
 
is there a way to amend the script to set other fields, for example the Short Description, from the parent catalog task??
1 ACCEPTED SOLUTION

Not applicable

Yes, you need to add it on one set(). Like this:

var url = new GlideURL("change_request.do");
url.set("sys_id" , "-1");
//url.set("sysparm_query" , "^parent=" + current.sys_id);
url.set("sysparm_query" , "^short_description=" + current.short_description +^parent=" + current.sys_id);

action.setRedirectURL(url.toString()+"");

View solution in original post

10 REPLIES 10

Not applicable

Yes, you need to add it on one set(). Like this:

var url = new GlideURL("change_request.do");
url.set("sys_id" , "-1");
//url.set("sysparm_query" , "^parent=" + current.sys_id);
url.set("sysparm_query" , "^short_description=" + current.short_description +^parent=" + current.sys_id);

action.setRedirectURL(url.toString()+"");