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 

6 REPLIES 6

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