Can we create a Change Request from a RITM

andytom
Kilo Contributor

If we receive a RITM from a customer, is there a way to create a Change Request directly from that RITM?

5 REPLIES 5

Utpal Dutta1
Mega Guru

Hey Andy,

Yes you can create Change form RITM by just right clicking on the RITM header or you can create a UI Action button.

 

Normal Change

(function(current, previous, gs, action) {
var changeRequest = ChangeRequest.newNormal();
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.configuration_item);
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
changeRequest.insert();

current.parent = changeRequest.getGlideRecord().getUniqueValue();
current.update();

gs.addInfoMessage("Change " + changeRequest.getValue("number") + " created");
action.setRedirectURL(changeRequest.getGlideRecord());
action.setReturnURL(current);

})(current, previous, gs, action);

 

Emergency Change

(function(current, previous, gs, action) {
var changeRequest = ChangeRequest.newEmergency();
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.configuration_item);
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
changeRequest.insert();

current.parent = changeRequest.getGlideRecord().getUniqueValue();
current.update();

gs.addInfoMessage("Change " + changeRequest.getValue("number") + " created");
action.setRedirectURL(changeRequest.getGlideRecord());
action.setReturnURL(current);

})(current, previous, gs, action);

 

You can check the image of same in the attachments.

 

If my reply was helpful then please mark it Helpful and Correct.

 

Thanks and Regards:

Utpal Dutta

Thanks for this. It works well for creating both Normal and Emergency changes.
Is it also possible to create a Standard change?

I'm thinking we might need to route to the page where we select the Standard Change template. If we then create a new change, will we be able to relate the RITM to the Change?

andytom
Kilo Contributor

I don't see an option to create a Change Request on the RITM Header.

Then try creating UI action button using above code