How to disable auto close for custom scoped applications inheriting incident table

Navaneeth1
Tera Guru

I have a custom scoped application inheriting from the incident table. This application only needs one state for closed so we kept that as the state 6 resolved. However, we realized that the global rules are automatically changing the field values to 7 after a couple days for our scoped custom application tables. 

Is there a way to make our custom scoped application to not be affected by this global state change without making any global changes?

1 ACCEPTED SOLUTION

Deborah Brown L
Kilo Sage

Hi @Navaneeth1 ,

There is a OOTB Business Rule named "incident autoclose". This script is updating the extended tables for Incident too.

It is not a best practice to do changes in OOTB scripts but for your requirement you have add a condition like if (

current.sys_class_name!= tablename) or (current.getTableName() != tablename).
Use the condition which works for you.
 
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.
 
Regards,
Deborah Brown

View solution in original post

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Navaneeth1 

 

https://docs.servicenow.com/bundle/washingtondc-application-development/page/build/applications/refe...

 

https://www.servicenow.com/community/itsm-forum/auto-close-a-custom-table-incident-after-2-days-of-b...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Deborah Brown L
Kilo Sage

Hi @Navaneeth1 ,

There is a OOTB Business Rule named "incident autoclose". This script is updating the extended tables for Incident too.

It is not a best practice to do changes in OOTB scripts but for your requirement you have add a condition like if (

current.sys_class_name!= tablename) or (current.getTableName() != tablename).
Use the condition which works for you.
 
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.
 
Regards,
Deborah Brown

@Deborah Brown L ,

Thank you so much for this response! Could you please let me know if the condition given below will work?

(current.getTableName()!='x_s_itsm_incident')||(current.getTableName()!='x_g_itsm_hc_incident')

I have two tables that need to be excluded and this is the condition I could think of but I have no way of testing this since the waiting period is 10 days. Could you please check if this condition code is correct syntax-wise? Like should the table name be in 'tablename' or "tablename" or no quotes is needed? or if anything else is missing or needs to be added?
Thank you so much in advance!

@Navaneeth1 ,

The condition is correct but do a round of testing before moving to Production as it is a OOTB script and if something is wrong, it will affect whole system.

Testing is very important