ScriptSync (VS Code)

Edit ServiceNow scripts in VS Code with real-time sync, AI agent support, and a file-based API — no copy-pasting between browser and editor.

ScriptSync connects your ServiceNow instance to VS Code, letting you edit scripts in a full-featured IDE. Changes sync in real-time — save in VS Code, see the update in ServiceNow immediately (and vice versa).

With version 4.0, ScriptSync adds native AI coding assistant support — changes made by Cursor, GitHub Copilot, Windsurf, or any tool that modifies files on disk are automatically detected and synced to ServiceNow.

Why Use ScriptSync?

  • Full IDE experience — Syntax highlighting, IntelliSense, multi-cursor editing, and all VS Code extensions
  • Real-time sync — Edits in VS Code appear instantly in ServiceNow, and changes in ServiceNow sync back
  • AI agent support — Changes from Cursor, GitHub Copilot, Windsurf, and other AI tools sync automatically
  • File-based Agent API — AI agents can query records, create artifacts, and control sync programmatically
  • Widget development — Edit Service Portal widget HTML, CSS, client script, and server script as separate files
  • No copy-paste — Stop switching between browser tabs and VS Code. Just save and it's synced.
  • Version control friendly — Your scripts are local files, so you can use Git for versioning

How It Works

  1. Install the sn-scriptsync VS Code extension
  2. SN Utils (the browser extension) detects when you open a script field in ServiceNow
  3. The script content is synced to a local file in VS Code
  4. Edit in either place — changes sync both ways in real-time

ScriptSync works with any script field in ServiceNow: Business Rules, Client Scripts, UI Actions, Script Includes, Scheduled Jobs, and more.

File Structure

Files are stored in a clean, organized structure:

instancename/scopename/tablename/recordname.field.extension

For example: myinstance/global/sys_script_include/MyUtils.script.js

Tables like sp_widget get their own folder with multiple files per widget (HTML, CSS, client script, server script).

In This Section

  • VS Code Sync — Installation, configuration, and basic sync workflow
  • Widget Development — Service Portal widget development with separate HTML/CSS/JS files
  • AI Agent Support — AI coding assistants, file-based Agent API, and automated sync