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.

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

Community Alums
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

Community Alums
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()+"");