Ui action throwing error 'Action not authorised'.

mahesh105
Tera Contributor

Standard change displaying error message "Action not authorized" on clicking Schedule button. there is no duplicate Ui action name schedule still it is showing this error.

 

Condition: gs.hasRole('itil,sn_change_write') && new ChangeFormUI(current).isScheduleAvailable()

script:

function moveToScheduled() {
g_form.setValue("state", "-2");
gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_scheduled");
}

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

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

 

4 REPLIES 4

Sagar Pagar
Tera Patron

Hi,

Is there another UI action with same action name "state_model_move_to_scheduled"?

 

If yes, you have to update action name. It will work.

 

Thanks,
Sagar Pagar

The world works with ServiceNow

@Sagar Pagar : There is no UI action with same action name "state_model_move_to_scheduled"

Hi @mahesh105,

You have to update action name. It will work.

 

Thanks,
Sagar Pagar

The world works with ServiceNow

jaheerhattiwale
Mega Sage
Mega Sage

@mahesh105 If you have already added the action name to the ui action then please try chnaging the function from "setRedirect();" to something else.

 

setRedirect(); might be some OOTB function servicenow might be using in backend

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023