Change Request - Revert to New UI from Authorize

Richo1
Tera Expert

Hello,

 

I'm trying to get the Revert to New UI functioning from the Authorize state in Change Request management.

 

I can get the UI to appear in the Authorize state using a script include to assess the condition as follows:

 

gs.hasRole("itil,sn_change_write") && ((current.type == ChangeRequest.EMERGENCY && new ChangeRequest(current).isAuthorize()) || (current.type == ChangeRequest.NORMAL && new ChangeRequest(current).isAssess()) || (current.type == ChangeRequest.NORMAL && new ChangeRequest(current).isAuthorize()))

 

When I go to 'Revert to New' I get the following message:

 

gs.getMessage('State Model for {0} changes does not allow reverting change from {1} state', [changeRequest.getValue('type')

 

I have looked at the following script include to see if I can modify the state model changes but with no luck:

ChangeRequestStateModel_normal

 

This is in my personal lab environment so I'm using the OOB workflows etc.

 

I have looked at the ServiceNow documentation and other community posts but I haven't had much luck. The ServiceNow documentation is pointing towards modifying the ChangeRequestStateModel_normal script include but I haven't been able to get this to function.

 

Thanks,

Richo

 

 

 

 

9 REPLIES 9

@Richo1 - Could you please run the below background script after replacing the sys_id of the change you are trying and check the result.

 

var gr = new GlideRecord("change_request");

if(gr.get('e2cdf552db252200a6a2b31be0b8f57f')){ //Please replace the sys_id of the change request and check the result
var cr = new ChangeRequest(gr);
gs.print(cr.getNextStates());  // This line should return two value -5 (New) and -2 (Scheduled)
gs.print(cr.revertToNew());  // This line should return true
}

 


Thanks & Regards,
Vasanth

Richo1
Tera Expert

Hi @Vasantharajan N results after running the supplied script, change was in the authorized state:
*** Script: -5,-2,4
*** Script: false

G_30
Tera Contributor

Hi 

 

I am having the same issue, did you able to find solution for this?

please advise. Thank you!

Heya,

I'm having the exact same issue too, did you manage to solve it in the end? I seriously can't find any solution for this...

Best regards,

Darius

Community Alums
Not applicable