BosskuAI ServiceNow Developer and Debugger
Use this skill to write idiomatic ServiceNow code and to troubleshoot instance problems by evidence first, root cause second, fix third.
How this differs from nearby skills
bosskuai-diagnose-loop: generic bug method (reproduce, minimise, fix, regression-test). This skill adds ServiceNow evidence sources and OOTB-versus-custom isolation.
systematic-debugging: general debugging discipline; same idea, no platform specifics.
bosskuai-jira-integration: another ticketing platform's API; unrelated code.
bosskuai-performance-profiling: general profiling; here only platform query and rule patterns.
Workflow
- Reproduce on a sub-production instance with one concrete record and user. Use a clone of production, because a small dev dataset hides real data shapes. If you cannot get one, ask the user to prepare it and say so in the result until it arrives. State expected versus actual and the scope (one form, one flow, all users).
- Gather evidence before changing anything: session or node logs,
gs.log or gs.info output, Script Debugger, a background script to run a query in isolation, and an ACL check for read/write denials.
- Check configuration first: system properties, plugin and activation state, recent update sets.
- Isolate OOTB versus custom: deactivate custom Business Rules, Script Includes, client scripts and ACLs one at a time on the sub-prod instance and retest. Restore anything that made no difference.
- State the confirmed root cause and its evidence before writing a fix.
- Pick the right surface. Reusable server logic goes in Script Includes; the client reaches it through GlideAjax (parameters via
getParameter), never by running server APIs in a client script. Flow Designer for orchestration, Business Rules for record-event side effects, client scripts and UI policies for form behaviour.
- Keep Business Rules lean: correct condition,
async or display where possible, and a header comment naming table, trigger and intent.
- Query hygiene:
GlideAggregate for counts and sums, bounded queries (setLimit, indexed fields), no unbounded loops, no hardcoded sys_ids (use properties or reference records). getValue() returns "0.01", not 0.01, so cast a value on purpose before you compare or sum it.
- Verify on the original record and on a second unrelated one; note the previous value of every record changed so the fix can be rolled back.
Guardrails
- Check the instance release and the current ServiceNow docs for API names and behaviour; they change between releases.
- Do not bypass ACLs or hardcode sys_ids to "make it work".
- Do not run scripts or deactivate rules on a production instance without explicit user approval; promote changes via update sets or source control.
- Disclose a script's side effects: records touched, notifications sent, tables queried.
- Count rows before and after any bulk script on the clone, and compare the result with the expected count before you run it on production.
- Make bulk updates safe to rerun: each run selects only rows not yet changed, processes a bounded batch, and a run after the last batch changes nothing.
- For REST Table API calls, set a timeout, page with
sysparm_limit and sysparm_offset to the last page, and retry a 429 or 5xx only when the call is safe to repeat.
- Mask passwords, tokens and personal data in
gs.log output and integration logs.
Output format
Symptom and scope: [expected vs actual, who, where]
Evidence: [log lines, ACL result, query counts]
OOTB vs custom: [artifact that changed the symptom]
Root cause: [statement + evidence]
Fix: [surface, code summary, side effects]
Verification and rollback: [records tested, prior values]
The shared quality bar: ../../references/checklists/engineering-quality-bar.md.
Adapted from agency-agents/engineering/engineering-servicenow-developer-mentor.md (agency-agents, MIT).
1---2name: bosskuai-servicenow3description: "Use when developing or debugging on ServiceNow: Business Rules, Script Includes with GlideAjax, GlideRecord versus GlideAggregate, Flow Designer, ACLs, and isolating whether a failure is out-of-the-box or custom."4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-servicenow6---78# BosskuAI ServiceNow Developer and Debugger910Use this skill to write idiomatic ServiceNow code and to troubleshoot instance problems by evidence first, root cause second, fix third.1112## How this differs from nearby skills1314- **`bosskuai-diagnose-loop`**: generic bug method (reproduce, minimise, fix, regression-test). This skill adds ServiceNow evidence sources and OOTB-versus-custom isolation.15- **`systematic-debugging`**: general debugging discipline; same idea, no platform specifics.16- **`bosskuai-jira-integration`**: another ticketing platform's API; unrelated code.17- **`bosskuai-performance-profiling`**: general profiling; here only platform query and rule patterns.1819## Workflow20211. Reproduce on a sub-production instance with one concrete record and user. Use a clone of production, because a small dev dataset hides real data shapes. If you cannot get one, ask the user to prepare it and say so in the result until it arrives. State expected versus actual and the scope (one form, one flow, all users).222. Gather evidence before changing anything: session or node logs, `gs.log` or `gs.info` output, Script Debugger, a background script to run a query in isolation, and an ACL check for read/write denials.233. Check configuration first: system properties, plugin and activation state, recent update sets.244. Isolate OOTB versus custom: deactivate custom Business Rules, Script Includes, client scripts and ACLs one at a time on the sub-prod instance and retest. Restore anything that made no difference.255. State the confirmed root cause and its evidence before writing a fix.266. Pick the right surface. Reusable server logic goes in Script Includes; the client reaches it through GlideAjax (parameters via `getParameter`), never by running server APIs in a client script. Flow Designer for orchestration, Business Rules for record-event side effects, client scripts and UI policies for form behaviour.277. Keep Business Rules lean: correct condition, `async` or `display` where possible, and a header comment naming table, trigger and intent.288. Query hygiene: `GlideAggregate` for counts and sums, bounded queries (`setLimit`, indexed fields), no unbounded loops, no hardcoded sys_ids (use properties or reference records). `getValue()` returns "0.01", not 0.01, so cast a value on purpose before you compare or sum it.299. Verify on the original record and on a second unrelated one; note the previous value of every record changed so the fix can be rolled back.3031## Guardrails3233- Check the instance release and the current ServiceNow docs for API names and behaviour; they change between releases.34- Do not bypass ACLs or hardcode sys_ids to "make it work".35- Do not run scripts or deactivate rules on a production instance without explicit user approval; promote changes via update sets or source control.36- Disclose a script's side effects: records touched, notifications sent, tables queried.37- Count rows before and after any bulk script on the clone, and compare the result with the expected count before you run it on production.38- Make bulk updates safe to rerun: each run selects only rows not yet changed, processes a bounded batch, and a run after the last batch changes nothing.39- For REST Table API calls, set a timeout, page with `sysparm_limit` and `sysparm_offset` to the last page, and retry a 429 or 5xx only when the call is safe to repeat.40- Mask passwords, tokens and personal data in `gs.log` output and integration logs.4142## Output format4344```text45Symptom and scope: [expected vs actual, who, where]46Evidence: [log lines, ACL result, query counts]47OOTB vs custom: [artifact that changed the symptom]48Root cause: [statement + evidence]49Fix: [surface, code summary, side effects]50Verification and rollback: [records tested, prior values]51```5253The shared quality bar: `../../references/checklists/engineering-quality-bar.md`.5455Adapted from agency-agents/engineering/engineering-servicenow-developer-mentor.md (agency-agents, MIT).