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.

Link change request to Story

Shristy Agrawa1
Mega Expert

Hello Team,

I would like to understand the end to end process on how we can create change request from story.

Currently it is there in incident

2 REPLIES 2

Community Alums
Not applicable

Hi @Shristy Agrawal ,

You create a new field on the story table called u_change_request then your UI action should be like

action.setRedirectURL(new StdChangeUtils().getURLForTask(current, 'u_change_request'));

ok but then you want parent field set on the change then you create a business rule on the story table after update when change request changes and change request is not empty and its like

var chg = current.u_change_request.getRefRecord();
chg.parent = current.getUniqueValue();
chg.update();

OR as you said you have it for incident , so take that as a reference and build for change.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Community Alums
Not applicable

Hi @Shristy Agrawal ,

Glad to see my answer helped you, Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep