Active = false not happening for closed tickets in a custom table (extending task)

SN Rookie
Giga Expert

Active = false not happening for closed tickets in a custom table (extending task). Isn't it something that should happen by default or do I need to code it?

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hello,

This will happen OOB and you dont need to add any additional configurations. You need to make sure that your closed state value is either 3, 4 or 7. This process is managed by the OOB business rule named "Task Active State Management" and Script Include "TaskStateUtil".

They key here is to ensure that your closed state value is matching with the inactive states defined by SN. This should also work if you include your closed state value within the SYSTEM_INACTIVE_STATES but former approach is recommended practice.

   SYSTEM_DEFAULT_CLOSE : 3, // task closed complete state
   SYSTEM_DEFAULT_WORK : 2, // task work in progress state
   SYSTEM_INACTIVE_STATES : [3, 4, 7], // task default inactive/close states

Thanks!

View solution in original post

7 REPLIES 7

So.  I'm looking at this again today.  Trying to go more OOB.  The Script Include sets the SYSTEM_INACTIVE_STATES property, but never references it in the Script Include.  What I'm finding, if the dictionary override is not set for a task type, the Business Rule does nothing, because inactive states returns undefined.

 

Does anyone see differently?  I checked an OOB London Developer Instance, and same issue.

You can check the function runMarkClosed where it is referred as this.SYSTEM_INACTIVE_STATES and also in runTaskCloser.

There is a task business rule that triggers it - "mark closed". Please check this out.

There are 2 ways to get this done, either use the default inactive states or by overriding the close_states attribute on your custom table's dictionary. The _getTableStates function in the initialize function triggers it up.

 

I see, it's used in the Condition.  I was stuck looking at the Task Active State Management business rule, that just drops off if the task table does not have its own states.  Confused at why there's two business rules that essentially are doing the same thing.

That's ServiceNow for you though 🙂