Move change request state from review back to assess

Elias9
Kilo Contributor

Hello SN Community,

I hope someone will help me with this.

I am new to SN but really learning.

I need step by step instruction as to how  move back  a change request state from Review State to Asses state. Becuase the change failed. Is it possible??? If so please provide step by step as I am new to SN environmnet.

 

Thank you SN community.

Appreciate your help.

 

1 ACCEPTED SOLUTION

okay got it. If it is just for one change request, then you do not need to follow the above steps as my thought was you need to setup a functionality for future change request as well.

For one change Request, you need to run a Background script and that should work for you.

Navigate to Background Script module as shown below:

find_real_file.png

Copy paste the below script and replace in line number 2 the correct sys id of the change request record for which you want to do this change.

var gr = new GlideRecord('change_request');
gr.get('e8f816d5c0a801640131b8101100744c'); //Replace sysID with your ChangeRequest SysID
gr.state = -4;
gr.setWorkflow(false);
gr.update();

Please try this in your Non Prod instances first before executing it in Production, just to be on a safer side.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

5 REPLIES 5

Laxmikanth
Tera Expert

Hi,

I don't think it is possible unless you customise. you can find more details about state model transitions on the link below

https://docs.servicenow.com/bundle/rome-it-service-management/page/product/change-management/concept/c_ChangeStateModel.html

shloke04
Kilo Patron

Hi,

There is no OOB way to do this. In order to achieve this, you need to follow the below steps:

1) Navigate to UI Actions module under System Definition Application menu and then click on New button as shown below:

find_real_file.png

2) Create a new UI action to allow users with an ability to move the change back to Assess state as shown below:

find_real_file.png

find_real_file.png

Note: You can add conditions in your UI Actions as well in case you want only certain users to have an ability to move the change back to Assess state.

3) Once done, on click of this UI Action, the change will revert to Assess state.

4) You can also write a line in your UI Action to retrigger the Flow or workflow which ever you might be using in your Change module as mentioned below.

Workflow:

new global.Workflow().restartWorkflow(current, true);

https://community.servicenow.com/community?id=community_question&sys_id=c18ff2e9db58dbc01dcaf3231f9619c2

Flow Designer: 

Flow designer cannot be restarted. Only way can be to cancel the current Flow Context and then reattach the Flow again. Please follow the steps as mentioned in below thread:

https://community.servicenow.com/community?id=community_question&sys_id=e7013d5adb7ae0903daa1ea6689619de

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Elias9
Kilo Contributor

Hi shloke04

will the above action affects all changes in the system or just one change request.

because my query is just for one single change request.

 

Thanks heaps

Elias

okay got it. If it is just for one change request, then you do not need to follow the above steps as my thought was you need to setup a functionality for future change request as well.

For one change Request, you need to run a Background script and that should work for you.

Navigate to Background Script module as shown below:

find_real_file.png

Copy paste the below script and replace in line number 2 the correct sys id of the change request record for which you want to do this change.

var gr = new GlideRecord('change_request');
gr.get('e8f816d5c0a801640131b8101100744c'); //Replace sysID with your ChangeRequest SysID
gr.state = -4;
gr.setWorkflow(false);
gr.update();

Please try this in your Non Prod instances first before executing it in Production, just to be on a safer side.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke