How to cancel change request of another user in ServiceNow.

praveen_rajan
Tera Contributor

Hello everyone,

I have a requirement where members of the "App Engine Admins" group need to have access to cancel change requests created by any user. By default, only the user who creates the request has access to cancel their own record. Can anyone please assist me end to end for implementing this?

 

Thanks,

Praveen

2 ACCEPTED SOLUTIONS

ShubhamGarg
Kilo Sage

Hello @praveen_rajan ,

There are two ways by which cancellation can be done.

1. UI Action 2. Drop-down value in state field.

----

To restrict an UI action visibility, you can put your conditions in the 'Condition' field in UI action record.

Example - Suppose "I" button should be visible to only members of 'App Engine Admins' group. In that case, you can put below query in condition box (right above script box) -

 

gs.getUser().isMemberOf(sys_id of group);
OR
//Best Practice - Store sys_id of group in system property
gs.getUser().isMemberOf(gs.getProperty(name_of_sys_property_without_space));

 

This script will check if current logged-in user is member of assignment group on current record.

Similarly, For drop-down of state field, Using client script & script include, you can check membership and use g_form.removeOption function to remove state value.

In addition to this, you can abort the operation & show appropriate message using Business Rule if state changes to cancelled and current logged in user is not member of given group.

Hope it helps.

 

If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.

Regards,

Shubham

View solution in original post

Hemanth M1
Giga Sage
Giga Sage

Hi @praveen_rajan ,

 

Go to UI actions>Cancel change

1)

HemanthM1_1-1724413317878.png

2) Add or condition to open the cancel button to "App Engine Admins" as highlighted below.

Make sure App Engine admins group has write access on the change request table

 

HemanthM1_0-1724413295285.png

 

Hope this helps!!!

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

6 REPLIES 6

Mark Manders
Mega Patron

Is cancelling done through a UI action? How is your current process customized? OOB any 'itil' or 'sn_change_write' user can cancel a change.

If it is change to just 'current.opened_by' you can update it with gs.getUser().isMemberOf('sys_id_of_your_group');


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

ShubhamGarg
Kilo Sage

Hello @praveen_rajan ,

There are two ways by which cancellation can be done.

1. UI Action 2. Drop-down value in state field.

----

To restrict an UI action visibility, you can put your conditions in the 'Condition' field in UI action record.

Example - Suppose "I" button should be visible to only members of 'App Engine Admins' group. In that case, you can put below query in condition box (right above script box) -

 

gs.getUser().isMemberOf(sys_id of group);
OR
//Best Practice - Store sys_id of group in system property
gs.getUser().isMemberOf(gs.getProperty(name_of_sys_property_without_space));

 

This script will check if current logged-in user is member of assignment group on current record.

Similarly, For drop-down of state field, Using client script & script include, you can check membership and use g_form.removeOption function to remove state value.

In addition to this, you can abort the operation & show appropriate message using Business Rule if state changes to cancelled and current logged in user is not member of given group.

Hope it helps.

 

If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.

Regards,

Shubham

Thanks for your response @ShubhamGarg . Can you please elaborate more on script include and client script with example.

Hemanth M1
Giga Sage
Giga Sage

Hi @praveen_rajan ,

 

Go to UI actions>Cancel change

1)

HemanthM1_1-1724413317878.png

2) Add or condition to open the cancel button to "App Engine Admins" as highlighted below.

Make sure App Engine admins group has write access on the change request table

 

HemanthM1_0-1724413295285.png

 

Hope this helps!!!

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025