- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2025 07:00 AM
I have created a new change model which has the following states: New, Scheduled, Implement, Review, Closed, Canceled. I have a state transition for "New to Scheduled."
I have also created a type = Model, when the change model is selected, the type value could be set to Model or null.
I need the "Schedule" ui action to display in Classic UI and Service Operations Workspace when the state is New. The out of the box condition "gs.hasRole('itil,sn_change_write') && new ChangeFormUI(current).isScheduleAvailable()" only works if the type = standard. I do not want to set the type=standard for my change model.
When I try to update the condition to this, as an example: "gs.hasRole('itil,sn_change_write') && new ChangeRequest(current).canMoveTo('-2')", the UI Action will display in the classic UI, but not SOW. I am generating this message "[ChangeRequestStateHandler]: _deriveModel: undefined type not specified. Using the ChangeRequestStateModel_normal script include."
I can't be the first person to have the requirement to have the "schedule" button display in a "new" state for a new change model. Does anyone have any suggestions or a solution?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:17 AM
Hi,
I imagine this is an oversight by ServiceNow given the adoption of models. If you haven't already, I'd suggest making Now Support aware.
To fix your issue, I'd amend the ChangeFormUI script include to override the behaviour which is the intended area to customise
var ChangeFormUI = Class.create();
ChangeFormUI.prototype = Object.extendsObject(ChangeFormUISNC, {
initialize: function(_currChgGr, _gs) {
ChangeFormUISNC.prototype.initialize.call(this, _currChgGr, _gs);
},
//override OOTB behaviour for our use case
isScheduleAvailable: function() {
//implement OOTB behaviour
if (this._gr.type == "standard")
return ChangeFormUISNC.prototype.isScheduleAvailable.call(this);
//add support for models
if (this._gr.tpye == 'model')
return new ChangeRequest(changeGr).isNextManualState("-2");
},
type: 'ChangeFormUI'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:17 AM
Hi,
I imagine this is an oversight by ServiceNow given the adoption of models. If you haven't already, I'd suggest making Now Support aware.
To fix your issue, I'd amend the ChangeFormUI script include to override the behaviour which is the intended area to customise
var ChangeFormUI = Class.create();
ChangeFormUI.prototype = Object.extendsObject(ChangeFormUISNC, {
initialize: function(_currChgGr, _gs) {
ChangeFormUISNC.prototype.initialize.call(this, _currChgGr, _gs);
},
//override OOTB behaviour for our use case
isScheduleAvailable: function() {
//implement OOTB behaviour
if (this._gr.type == "standard")
return ChangeFormUISNC.prototype.isScheduleAvailable.call(this);
//add support for models
if (this._gr.tpye == 'model')
return new ChangeRequest(changeGr).isNextManualState("-2");
},
type: 'ChangeFormUI'
});
