Cancel Change dialog is briefly shown again after submission


Description

UI Page change_confirm_cancel remains after clicking on "OK".

Steps to Reproduce

Navigate to an open Change Request
Cancel the Change via the Cancel Change UI Action
Add a comment and click OK
Note that the dialog is presented again without the comment (due to onChange client script on state field)
Expected the dialog to only be presented once

Workaround

The solution and workaround is to update the "Cancel Change" UI Action to have the following script:
/sys_ui_action.do?sys_id=4f2777b3cb100200d71cb9c0c24c9c91

Script:
==================
var changeConfirmCancelDialog;

function setChangeCancelState() {
g_form.setValue("state", "4");
}

if (typeof window == 'undefined')
setRedirect();

function setRedirect() {
current.update();
action.setRedirectURL(current);
}
=========

You can replace all of the script in the UI Action with the above.

***note*** that the "loadConfirmDialog" function has been replaced by "setChangeCancelState", so the "Onclick" field must be updated to "setChangeCancelState();"


Related Problem: PRB1503977