Understanding the State field
The state of a task drives a tremendous amount of business logic in a typical ServiceNow application. It represents how a task is progressing-whether it should be worked on, whether it actually is being worked on, and when the task is done. This may drive e-mail notifications, be a trigger for service-level monitoring, or be a condition for a security rule, to name but a few.
The State field in the Task table is an integer choice field. This means a number is stored in the database, while the available options are given labels. In general, scripts use the number value while the UI displays the label. This table details the relationship between the two:
Label |
Number |
Description |
---|---|---|
Pending |
-5 |
The task exists, but it shouldn't be worked on yet. It may have been created for planning reasons. The convention is that any number less than 0 represents a state that hasn't yet started. |
Open |
1 |
The task has been created, but no one is working on it yet. |
Work in Progress... |