Incident management gets the dashboards and the SLA clocks; problem management, the ITIL
process meant to find and fix the root cause behind repeat incidents, usually does not. A
problem record can sit in "Root Cause Analysis" for months with nobody noticing, because
ServiceNow has no default alert for problem age the way it does for incident SLA breach. This
blueprint reads the problem table directly and turns age into a governance signal.
This blueprint was created by Mohit Jeswani.
How it works
get_aging_problems (io.kestra.plugin.servicenow.Get) queries the problem table with an
encoded query: active=true, sys_created_on older than max_open_days, and optionally a
priority ceiling. Read-only; nothing in ServiceNow is changed.
evaluate (io.kestra.plugin.core.output.OutputValues) compares the matched count (size)
against max_count.
route (io.kestra.plugin.core.flow.If):
- compliant: logs that nothing matches.
- alert: posts the count to Slack.
summary logs the count and severity, closing the governance cycle.
errors alerts Slack if the flow itself fails, for example expired credentials.
What you get
- A governance signal for the one ITIL process ServiceNow's own dashboards tend to leave
unmonitored: how many root causes are still open past your own SLA for finding them.
- A query that relies only on the standard
active field, so it works without hardcoding this
instance's specific problem-state labels.
- A tunable priority ceiling, so a team can choose to watch only critical and high problems
while leaving low-priority backlog unalerted.
Who it's for
- ITSM and platform teams running ServiceNow who track incident SLAs closely but have no
equivalent alert for problem record age.
- Teams evaluating the ServiceNow plugin who want a worked example of
Get with an encoded
sysparm_query, against the problem table specifically - distinct from this repo's
existing ServiceNow blueprints, all of which read or write incident, change_request, or
cmdb_ci_* tables.
Why orchestrate this with Kestra
ServiceNow has SLA definitions and notifications built for incidents, but nothing out of the
box pages anyone when the problem backlog itself grows stale. Kestra keeps max_open_days and
the priority ceiling as flow inputs, turns the query into a single Slack number on a schedule,
and keeps a full execution history of every check, not just whatever the last person to open
the problem list happened to notice.
Prerequisites
- A ServiceNow instance with the Problem Management application active and Table API access
enabled.
- A ServiceNow account (Basic Auth, or OAuth password grant via
clientId/clientSecret) with
read access to the problem table.
- A Slack incoming webhook URL.
This flow calls the ServiceNow Table API directly over HTTPS; there is no official local
ServiceNow emulator, so get_aging_problems cannot be exercised against a local Docker
container. AbstractServiceNow's own uri property can point this task at a mock HTTP server
implementing the same Table API shape for contract testing, but proving max_open_days against
real aged records needs a real (ServiceNow Developer Program) instance.
Secrets
SERVICENOW_USERNAME / SERVICENOW_PASSWORD: Basic Auth credentials used by
get_aging_problems. In Kestra OSS, provide them as the base64-encoded environment variables
SECRET_SERVICENOW_USERNAME / SECRET_SERVICENOW_PASSWORD.
SLACK_WEBHOOK_URL: used by alert and the errors block. In Kestra OSS, provide it as the
base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.
Inputs
| Input |
Default |
Purpose |
domain |
<your-instance> |
ServiceNow subdomain |
max_open_days |
30 |
Age past which an active problem is reported aging |
priority_filter |
empty |
Optional max priority value (lower is more urgent) to include |
max_results |
100 |
ServiceNow sysparm_limit for this check |
max_count |
1 |
Matched-problem count that triggers the Slack alert |
Outputs
{{ outputs.get_aging_problems.results }}: the matched problem records (number,
short_description, priority, state, sys_created_on, assigned_to).
{{ outputs.get_aging_problems.size }}: number of matching problems.
{{ outputs.evaluate.values.severity }}: OK or PROBLEM_BACKLOG_AGING.
Pitfalls
- Relying on
active=true to exclude resolved/closed problems assumes this instance's problem
state flow sets active to false on resolution, which is the ServiceNow default but can be
customized away in heavily configured instances. Check your own state model if the count
looks wrong.
max_results caps sysparm_limit; a backlog larger than this returns only the first page in
whatever order ServiceNow applies by default (no sysparm_query sort is set here). Add an
ORDERBY clause to query to control which aging problems surface first.
priority_filter compares against ServiceNow's numeric priority field, where a lower number
is more urgent (1 = Critical) - priority_filter: 2 means "2 or more urgent", not "2 or
higher".
- Basic Auth credentials are sent on every request; the OAuth password grant
(
clientId/clientSecret) is available on the same task if your instance requires it
instead.
Quick start
- Add the
SERVICENOW_USERNAME, SERVICENOW_PASSWORD and SLACK_WEBHOOK_URL secrets.
- Set
domain to a real ServiceNow instance with at least one active problem record.
- Run the flow with the defaults and confirm
summary logs a count.
- Raise
max_open_days past every open problem's age to confirm compliant logs instead.
- Enable the
daily trigger once the threshold reflects your own problem-management SLA.
How to extend
- Loop per
assignment_group with io.kestra.plugin.core.flow.Loop and a matching query
addition to send each team its own aging count instead of one instance-wide total.
- Add an
ORDERBYDESC=sys_created_on clause to query so the oldest problems are always the
ones in the returned page when the backlog exceeds max_results.
- Read
outputs.get_aging_problems.results in a downstream task to post the actual problem
numbers and assignees, not just the count.
Links