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 ... |
Get Mastering ServiceNow - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.