Change Request - Revert to New UI from Authorize
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 08:57 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 10:42 PM - edited 02-15-2023 10:42 PM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 04:30 PM
Hi @Vasantharajan N results after running the supplied script, change was in the authorized state:
*** Script: -5,-2,4
*** Script: false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 06:51 AM
Hi
I am having the same issue, did you able to find solution for this?
please advise. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2023 06:05 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 03:49 AM - edited 03-18-2024 03:53 AM
Hi @Richo1 @Dariussiriuse @G_30
This article will help you out 🙂
Solution: Revert to New from Scheduled State in Change Request