Showing posts with label ACL. Show all posts
Showing posts with label ACL. Show all posts

Wednesday, August 05, 2026

Platform Fundamentals for AI-Ready ServiceNow (Chapter 1: Learning ServiceNow AI)

Chapter 1: Platform Fundamentals for AI-Ready ServiceNow

This is the first in a chapter-by-chapter series walking through ServiceNow's AI stack, from the ground up. Before touching Now Assist, Agent Studio, or MCP, it's worth being honest about something: every AI feature on this platform is only as good as the data and workflow foundation underneath it. This chapter covers that foundation, with real examples of what goes wrong when it's skipped.

1. Data Model & CMDB Basics

AI features don't reason over a clean abstraction — they reason over whatever records and relationships actually exist in your instance. Bad CMDB data doesn't just cause reporting headaches anymore; it now feeds directly into what an AI agent tells a user.

Example — a mismodeled relationship producing a wrong AI summary:

Say an incident is raised against a business application, "Expense Portal," which is supposed to run on a specific application server CI. If that cmdb_rel_ci relationship was never created — or was created against the wrong server after a migration — then when Now Assist generates a summary of "related incidents affecting this service," it will either miss genuinely related incidents or pull in unrelated ones tied to the wrong server. The AI isn't wrong; the data it was handed was.

What to actually learn:

  • The difference between a cmdb_ci record and a cmdb_rel_ci relationship record — they are separate tables, and a CI with no relationships is functionally invisible to anything doing impact analysis.
  • How to trace a CI's relationships visually using the dependency view, before assuming a relationship exists just because two records reference the same service.
  • Why reconciliation identification rules matter — a duplicate CI created by a second discovery source silently splits your relationship data across two records instead of one.

2. Flow Designer Essentials

Most Now Assist and agentic features eventually call into, or get called from, a flow. You don't need to be a flow expert before touching AI features, but you do need to be able to read one and know where an AI-driven action would plug in.

Example — a simple approval flow, annotated:

Take a basic hardware request approval flow: Trigger (record created on sc_request) → Ask for Approval (manager) → If Approved: Create Task → If Rejected: Notify Requester. This is the kind of flow a beginner should be able to open in Flow Designer and narrate out loud, step by step, before ever adding an AI action to it. Once you can do that, an AI-driven insertion point becomes obvious — for instance, a generative action summarizing the request's justification text for the approver, inserted right before the "Ask for Approval" step, so the approver sees a two-line summary instead of a wall of free text.

What to actually learn:

  • Triggers, actions, and subflows — and the difference between a flow and a subflow reusable across multiple parents.
  • Reading flow logs to see exactly which branch executed and why, since this is the same skill you'll need later to debug an agent's tool-calling decisions.
  • Where flow variables come from and how they're passed between steps — generative actions consume and produce these the same way any other action does.

3. ACLs and Roles

An AI agent doesn't get its own separate permission universe — it typically runs as a service account or inherits context from the user it's acting on behalf of. If that account's role is too broad, the agent can read or touch data nobody intended it to.

Example — an over-permissioned agent account:

Imagine a case-summarization agent given the itil role for convenience during setup, instead of a scoped role limited to the specific table and fields it needs. Because itil grants broad read access across incident, problem, and change tables, the agent's summaries can end up referencing details from records the requesting user was never meant to see — a classic over-scoping problem that predates AI, but that AI makes more visible because the output is now surfaced directly to an end user in prose.

The fix: create a dedicated role scoped to exactly the tables and fields the agent needs, apply it via an ACL rather than relying on a broad out-of-box role, and test by impersonating the agent's account directly rather than assuming the scope is correct.

What to actually learn:

  • How ACLs evaluate — table-level, field-level, and the role requirements attached to each.
  • The "Elevate Roles" and impersonation tools for actually testing what a given role can see, rather than assuming from the role name.
  • Why least-privilege matters more, not less, once an account's output becomes user-facing prose instead of a raw list a developer would sanity-check.

4. Basic Scripting: GlideRecord & GlideAjax

This isn't about becoming a scripting expert before touching AI features — it's about being able to read what a generated script is actually doing, since Now Assist for Creator and Build Agent will hand you code, and you need to be able to sanity-check it rather than deploy on faith.

Example — a script a beginner should be able to read line by line:

var gr = new GlideRecord('incident');
gr.addQuery('priority', 1);
gr.addQuery('state', '!=', 7); // exclude closed
gr.query();
while (gr.next()) {
    gs.info('High priority incident open: ' + gr.number);
}

A beginner should be able to say, out loud, exactly what this does: it opens a query against the incident table, filters to priority 1 records that aren't closed, runs the query, and logs each matching incident's number. That's the bar — not writing this from scratch, but reading it and catching if an AI-generated version of this query forgot the state filter and would have logged every priority-1 incident ever created, closed or not.

What to actually learn:

  • GlideRecord query patterns — addQuery, addEncodedQuery, and why the order of chained queries matters.
  • GlideAjax basics — the client-to-server call pattern, since generative actions and agent tools follow a similar request/response shape.
  • Where to spot common AI-generated mistakes: missing null checks, unscoped queries that should have been scoped, and queries that will run but return the wrong data quietly rather than erroring loudly.

Checkpoint Before Moving to Chapter 2

You should be able to: trace a CI's relationships and explain what breaks if one is missing; open a flow in Flow Designer and narrate its logic step by step; impersonate a role to verify what it can actually see; and read a short GlideRecord script and say exactly what it does and doesn't filter for. None of this requires expert-level depth — it requires enough fluency that when Now Assist hands you a generated flow or script in the next chapter, you're reviewing it, not trusting it blindly.

Next in this series: Chapter 2 — Now Assist as a Consumer, with a walkthrough of enabling it for ITSM and a real before/after of an incident summary.

Sunday, December 14, 2025

Why ServiceNow Schedule Calendars Suddenly Stop Working (Even Without Role Changes)

Why ServiceNow Schedule Calendars Suddenly Stop Working (Even Without Role Changes)

A user reports:

"Last month I could open the Schedule Calendar using 'Show Schedule,' but now I get a Security constraints prevent access message."

No role changes. No group changes. No recent deployments touching On-Call. Yet the calendar suddenly becomes inaccessible.

This scenario is far more common than it appears, and it usually isn't a defect. It's a data-level permission shift — a silent change that occurs underneath the roles and groups. Let's break it down.

1. Schedule access isn't controlled only by roles

Many ServiceNow users assume:

"If I'm in the right group and have on-call roles, I can access the schedule."

But schedule access depends on ownership and underlying ACLs, especially on these tables:

  • cmn_schedule — the base schedule record
  • cmn_rota — the on-call shift record layered on top of a schedule
  • cmn_schedule_span and, for On-Call Scheduling specifically, roster_schedule_span — the individual time spans that make up the calendar view

If the owner group, schedule, or rota visibility shifts — even slightly — a user may lose access without any admin touching their roles.

Typical causes

  • Schedule ownership changed to a group the user is no longer part of
  • Rota owner field updated accidentally
  • A new ACL was introduced by another team or plugin
  • A schedule was copied from another environment with different permissions

2. "Show Schedule" loads a calendar UI page — and that page enforces ACLs

The "Show Schedule" link loads a specific UI Page that visually renders the calendar. This page queries schedule records, loads rota and span data, and renders only what the user is allowed to see.

If the user fails even one ACL check on any related record (for example, a span they cannot read), the entire page can fail with:

Security constraints prevent access to requested page

Even though the user has the same roles and the same group membership, they can still fail an ACL evaluation because the data they're trying to view is now restricted.

3. Why it "used to work" and now it doesn't

This is the most confusing part for users. It happens because someone changed the schedule's group, the rota's owner, a span record's permissions, or a schedule was overwritten or reimported — or a Dev → Test → Prod migration created mismatched access.

These changes often happen silently:

  • A rota owner edits the group
  • Another support team updates a schedule
  • Copy changes from one environment alter ownership
  • A plugin update modifies ACL inheritance

No code change. No role change. But access breaks.

4. The quickest way to diagnose the issue (admin steps)

Step 1 — Test as the impacted user (Impersonate). Try to open the group, the on-call schedule, the specific rota, and the calendar UI page. Find what fails.

Step 2 — Check these ACLs. Review read ACLs on cmn_schedule, cmn_rota, and cmn_schedule_span (or roster_schedule_span if On-Call Scheduling is active). If any "read" ACL denies access, the calendar collapses completely.

Step 3 — Confirm schedule ownership. Check Schedule → Group, Rota → Group, and Coverage/Span → Owned by which group. If ownership belongs to a private group the user cannot see, the calendar stops loading.

5. How to prevent this issue in the future

  • Lock schedule ownership. Assign a single designated owner group for on-call schedules and restrict edit access.
  • Prevent accidental schedule overwrites. If teams import or export schedules across environments, enforce update sets with fixed ownership and restrict access to schedule tables.
  • Build a diagnostic report that flags schedules owned by private groups, rota records with mismatched permissions, and spans that belong to inconsistent groups.
  • Add a knowledge article for end users so that instead of panic escalations, they understand what the error means, why it occurs, and how to request access properly.

Conclusion

When "Show Schedule" suddenly stops working, it's rarely a defect — it's usually data-level permission drift. The underlying tables powering on-call scheduling are sensitive to ownership and group visibility, and even a small shift can break the UI page.

With controlled ownership, regular audits, and a simple access troubleshooting checklist, this becomes a preventable issue.


Table and field names referenced here reflect the base Common Schedule and On-Call Scheduling data model. Exact ACL configuration and inherited access rules can vary by instance, active plugins, and customizations — verify against your own instance before making ACL changes.