Clarify table elements: incident_state vs state; active

tayrez
Giga Contributor

Hello,

What is the difference between incident_state and state on the Incident table?   How are they used (out of box)?   What is their relationship?

Active Field   (not specifically the incident table):   What is it used for?   What sets the switch? Where I can I learn more about it?

Thanks,

Therese

1 ACCEPTED SOLUTION

Hi Therese,



You're welcome!



As for the other question, the active state in the task table is managed primarily by a business rule which is called Task Active State Management. That business rule will set the active state in accordance to whether the state of the task is an "inactive type of state". That definition of an inactive state can be found in the script include TaskStateUtil which specifies the states   3, 4 and 7 as inactive states.



On a similar way, there's a lot of business rules that actually set the active flag to false, but from what i know, OOB there's consistency in setting respective state values that represent an inactive item. (You can see these by searching in business rules and other server/client scripts for where the script field contains .active = false)



In your case, i believe you could have some customizations (or users) that perhaps are directly setting the active flag to false without setting the respective state to an inactive type of state.



I hope this is helpful!



Thanks,


Berny


View solution in original post

15 REPLIES 15

Mike Allen
Mega Sage

state is on task, incident_state is on incident.   There are business rules that synch the two.



When a record goes to closed, active is set to false.   That way, you can filter out inactive records in your lists and make them much shorter.   There are business rules that set active to false under certain circumstances.



I would look at these BRs on task and its extended tables to see when they change to inactive.   You can add rules to deactivate any unused records by copying these rules.


Thank you.



Is there any distinction between incident-state and state on the Incident table Out of Box version?



We have records where the states aren't Closed Complete, etc. and Active is False which is confusing.


notActivePending.PNG


I would make all those records active = true, then investigate when they were turned to active=false and what was done simultaneously so you can better understand it.   There may be a condition that is firing that should not be that is causing this.   Sometimes this is caused by changing state values, sometimes it is caused by an accidental background script run that did this.



state and incident_state are the same, for all intents and purposes.  


Hi Therese,



I can recall this was a big surprise for me as well when I got started in ServiceNow. If i'm not mistaken i learned that it was better to update and rely on the incident-state. There's a whole logic to keep these in sync, so be very careful whenever adding or changing states.



Also, please be aware that the items that you share on your prior screenshot are not incidents. .



I hope this is helpful!



Thanks,


Berny