Need to Restrict the usage of "Closed" state for incidents in List view (only closed state)

PavithraDeB
Tera Contributor

Please do help me to clarify below concerns.

Requirements: Need to Restrict the usage of "Closed" state for incidents in List view (only closed state)

Through a client script i can achieve it in legacy view but the ame doesnot applies to Service operation workspace

function onCellEdit(sysIDs, table, oldValues, newValue, callback){
var saveAndClose = true;
if(newValue == 7)
alert("You cannot change the State value to 'Closed' from a list view");
saveAndClose = false;
callback(saveAndClose);

}
while exploring, i could notifce that the oncell edit will not work in SOW (Not sure , may be there is a way)


Any help would be greatly appreciated.
PavithraDeB_0-1773848101831.png

 


PavithraDeB_1-1773848101814.png

i wanted this restriction only for closed state in LIST EDIT and not in form level.
Thank you 

8 REPLIES 8

So, in summary, what would be your recommended approach? TBH, I do not fully understand approach 2, so if you could detail it similarly and likely provide a gif like for approach 1, it would be amazing!

Also, does the proposed BR (approach 1) replace the behaviour initially forced in the native/classic UI by the client script from the very first post?

PavithraDeB
Tera Contributor

Hi @Ankur Bawiskar 
Thank you for your response, However iam struck here.

If iam using a BR with above condition, form level closure of incident is getting

 
 

Note: I need the restriction only in list edit, not any form level restriction needed, users/caller of the incident should be able to close it from from/self service portal.

Thank you.

Screenshot 2026-03-19 121601.png

 And the  "sys_ux list shows the HAM application, and not much debugging i could do.
Any second thoughts.

And in the BR_trying to sort if the difference can be found for list edit or form edit using

if (gs.action.getGlideURI().toString().indexOf("xmlhttp.do") == 0) {

  // updated from list

}

else {

  // updated from form

}


But not much solution i get and strcuk here. 
Any second thoughts? Thank you.

@PavithraDeB 

BR can't determine if user is updating from workspace list or portal etc

you can try to check the URL thing but I doubt this will work

Either disable it completely for all fields using the inline editing option I already informed

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

BrunoPer
Tera Contributor

I've implemented a business rule like the one described here - see attached - but soon I found this was interfering with my system Schedule Item - Autoclose Incidents, running Business Rule - incident autoclose that finally calls System Property - glide.ui.autoclose.time.

This caused us a problem, as we ended up blocking the system from automatically closing incidents after the number of days defined in the system property.

Would this be the reason why this is not a system default behaviour - (not) allowing users to close incidents from the list view? How did you bypass this challenge?

BrunoPer_0-1780501544763.png

BrunoPer_1-1780501568728.png