Modify Change Request Script Includes

scwillson
Mega Guru

Starting with Geneva, the OOTB Change Management Application has been significantly improved with many things. One of the most confusing parts of it for me are the script includes.

To meet the needs of a client, I've had to modify the standard change to have a Change Manager approval in the workflow. I have already copied the OOTB workflow for standard changes, and modified it to include the approval. The issue I am having is knowing which script includes to modify, and how to do it.

Also, I don't understand what the script between the "Class.create()" and "prototype" lines is doing. A few of the change request script includes have it. (for example: ChangeRequest from lines 3-6.)

var ChangeRequest = Class.create();

ChangeRequest.NORMAL = "normal";

ChangeRequest.STANDARD = "standard";

ChangeRequest.EMERGENCY = "emergency";

ChangeRequest.CHANGE_REQUEST = "change_request";

ChangeRequest.prototype = {

I was able to modify the "ChangeRequestStateModel_standard" script include, to make the "authorize" state the "nextState" available after draft. However, it doesn't affect the system to show the appropriate UI action for the Draft State while in standard changes, or the action taken with the UI action.

Any feedback to help me better understand the system of script includes with Change Requests would be awesome.

Thanks!

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Simon,



the first few lines of code are just declarative statements to set some constants available to the rest of the script include. Putting these up front makes it easier to change. They correspond to the type field of the change request.



As for the rest, these may help:



Geneva: Three "c"hanges with a Big Impact on Change Management


Geneva: Change Management - Making Change a Little Less Painful  


View solution in original post

6 REPLIES 6

Hi Chris,



It is my understanding that this method (above) predates the use of close_states attribute and the newer TaskUtil and change script includes with state flows.


Hi Chuck,

Could you please help me on below requirement.

 

I have a requirement to pass the current Change request number and update the work notes with that number through the Copy Change UI action.

Could you please let me know how do I pass the current change request number?

 

I am trying like this and it's printed the comment but couldn't able to pass the current change request number.

 

addParam(form, 'sysparm_query', queryParam + '^u_copied_change=true' +'^work_notes =This Change has been copied from:' + ????????);

Any help will be much appreciated!!!