How to revert the change request state from schedule to new using revert to new button.

Deepthi9
Kilo Contributor

How to revert the change request state from schedule to new using revert to new button. Without altering the OOB script.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Deepthi,

You need to create UI Action which is server side and sample code below

UI Action Condition: visible when current state is schedule

// give here valid choice value for schedule

current.state == '5'

Script:

current.state = '2'; // give here the correct choice value for new

current.update();

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Deepthi,

You need to create UI Action which is server side and sample code below

UI Action Condition: visible when current state is schedule

// give here valid choice value for schedule

current.state == '5'

Script:

current.state = '2'; // give here the correct choice value for new

current.update();

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

How is it related to revert to new button. Do we not change the state model script include ??

Hi Deepthi,

Since you don't want to change OOT box script so this UI action

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Im able to revert but workflow remains the previous state only..  How do revert the workflow activities also along with it.