Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

artemzhuchkov
ServiceNow Employee
ServiceNow Employee

Greetings, fellow platform professionals! Are you tired of treating your carefully crafted ServiceNow updates like delicate glass sculptures that must be manually transferred between instances, all while praying an accidental update set doesn't shatter your progress? Is sharing your latest scope application with a colleague an exercise in administrative patience?

The solution to these modern development woes is both powerful and surprisingly straightforward: Source Control.

 

By integrating the ServiceNow IDE (the VS Code Extension) with GitHub and leveraging the intelligence of the Build Agent, we can modernize our workflow from mere instance configuration to a true, professional software development lifecycle.

In this detailed guide, we will embark on a beginning-to-end journey. We'll establish a GitHub connection and demonstrate the fundamental source control capabilities available directly within the ServiceNow IDE. Prepare to elevate your development environment and ditch those legacy management headaches.

 

The Unassailable Logic: Why GitHub + Build Agent is Essential

Adopting GitHub as your authoritative source for application code, facilitated by the ServiceNow Build Agent, provides three critical advantages for any serious development team:

  1. Effortless Migration and Collaboration: It lets you more easily save changes to move instance to instance or share apps with others. Your code becomes a portable, versioned asset, allowing for predictable deployments to development, test, and production environments, and simplifying collaboration via standard Git branching and merging.
  2. The Ultimate Safety Net (The "Undo" Button): You can rollback and revert changes easily. Accidents happen. Whether it's a misplaced semicolon or an entire function that needs removal, source control provides an instant history of your codebase. You can instantly revert to any previous, stable commit.
  3. Audited and Transparent History: You see clearly what code changes have been made by Build Agent or other developers. Every commit provides an immutable record of who made what modification and when. This high-fidelity audit trail is indispensable for compliance, code review, and debugging.

Ready to transcend the limits of update sets and embrace the future of ServiceNow application development? Let's proceed with the setup! 👇

 

Prerequisites

  • Access to ServiceNow IDE
  • Access to Build Agent (Zurich)

 

Contents

  • Creating your GitHub access token for authentication – Part 1
  • Create a new repository for your new or existing app. – Part 2
  • Set up ServiceNow IDE to connect with your GitHub – Part 3
  • Create a new branch and a README for your app with Build Agent – Part 4
  • Navigating between branches– Part 5

 

Creating your GitHub access token for authentication – Part 1

  1. Click User Image -> Settings

artemzhuchkov_0-1763483476285.png

 

  1. Scroll down and click Developer settings

artemzhuchkov_1-1763483476288.png

 

  1. Click Personal access token -> Tokens (classic)

artemzhuchkov_2-1763483476289.png

 

  1. Click Generate new token

artemzhuchkov_3-1763483476289.png

 

  1. Click Generate new token (classic)

artemzhuchkov_4-1763483476295.png

 

  1. Fill out the fields and specify ‘repo’ at a minimum I added workflow and packages for good measure! It’s best practice to set an expiration date but I’ve gone ahead and set ‘No expiration’

artemzhuchkov_5-1763483476302.png

 

  1. Scroll to the bottom and click Generate token

artemzhuchkov_6-1763483476303.png

 

  1. Save the token in your notepad or somewhere you can refer to it later.

 

Create a new repository for your new or existing app. – Part 2

  1. Go back to the home page on github
  2. Click the + and then click New repository

artemzhuchkov_7-1763483476305.png

 

  1. Give it a Name and Description. Also note your GitHub Username – you will need this later.

artemzhuchkov_8-1763483476309.png

 

  1. Click Create repository

artemzhuchkov_9-1763483476310.png

 

  1. Note your Repository https url ending in .git – you will need this later.artemzhuchkov_41-1763483716618.png

     

 

Set up ServiceNow IDE to connect with your GitHub – Part 3

  1. Log in to you ServiceNow instance and navigate to ServiceNow IDEOpen a workspace with some code or create a new workspace and create a new app with Build Agent.                                                          artemzhuchkov_0-1763485659598.png

     

  2. Click Source Control Icon and then click Initialize Repository

artemzhuchkov_45-1763483887544.png

 

  1. Give your default branch a name

artemzhuchkov_46-1763483950994.png

 

  1. Click the + button to track / stage changes for all the files in the project

artemzhuchkov_47-1763483980214.png

 

  1. Click the check box at the top to commit the changes to your repo

artemzhuchkov_48-1763483996884.png

 

  1. Type in a commit message – then press ‘Enter’

artemzhuchkov_49-1763484022741.png

 

  1. Click the 3 dots next to Source Control

 

artemzhuchkov_51-1763484067492.png

 

  1. Click Push

artemzhuchkov_52-1763484087816.png

 

 

  1. You will be prompted to Enter a github repository url - enter your git url ending in .git

artemzhuchkov_53-1763484116991.png

artemzhuchkov_54-1763484166851.png

 

  1. You should get a “Git credential not found" pop up in the bottom right – Click Configure

artemzhuchkov_55-1763484215415.png

 

  1. You should get a pop-up like so.

artemzhuchkov_56-1763484241847.png

 

  1. Enter you Git username and personal access token noted from the previous steps then click Submit

artemzhuchkov_57-1763484274123.png

 

  1. Confirm this was success in the Output logs in the bottom console.

artemzhuchkov_58-1763484294154.png

 

  1. Go back to your GitHub repository (refresh) – you will see your commit and pushed files

artemzhuchkov_59-1763484330113.png

 

Create a new branch and a README for your app with Build Agent – Part 4

  1. In ServiceNow IDE > Source Control Tab click the 3 dots then click Branch > Create Branch

artemzhuchkov_60-1763484374925.png

 

  1. Give it a name such as – “Branch-1” or “README-Branch”

artemzhuchkov_61-1763484402348.png

 

  1. Go to Build Agent panel on the right and ask it to “Create a GitHub friendly README file for this application”

artemzhuchkov_62-1763484450942.png

 

  1. Notice in Source Control we have a new file that’s under Untracked Changes. Click the + to Stage the change

artemzhuchkov_63-1763484501147.png

 

  1. Click the check box next to Source Control to Commit the change

artemzhuchkov_64-1763484540287.png

 

  1. Enter in a commit message – press ‘Enter’

artemzhuchkov_65-1763484567833.png

 

  1. Push the changes to GitHub

artemzhuchkov_66-1763484592342.png

 

 

  1. Go back to GitHub and select your new branch

artemzhuchkov_67-1763484619228.png

 

  1. You should see your newly created and pushed README when you scroll down.

artemzhuchkov_68-1763484648360.png

 

 

Navigating between branches– Part 5

 

  1. You can navigate between branches as ‘versions’ of your project by first clicking on any application file in your workspace.

artemzhuchkov_69-1763484689125.png

 

  1. You will then see a new icon at the bottom left corner of the IDE

artemzhuchkov_70-1763484709277.png

 

  1. This will open a pop-up to make it easy for you to switch between branches or create new ones. I personally use this to have different versions of my vibe coded apps.

artemzhuchkov_71-1763484726810.png

  1. Remember to Build & Deploy the app if you want the code changes from a branch change to reflect in your live app.

 

Comparing Changes and Reverting Changes – Part 6

  1. Make changes to one of your files or just ask build agent to edit any part of your existing application.
  2. When you open Source Control and click on any of the files you can clearly see the changes that have been made

artemzhuchkov_72-1763484780179.png

 

  1. You can also cleanly roll-back changes by clicking the ‘backward arrow’ in the source control list

artemzhuchkov_73-1763484811282.png

 

  1. Pro-Tip: You can also select multiple changes from the list and roll them all back instead of doing them one by one.

 

And there you have it! By connecting the ServiceNow IDE and Build Agent to GitHub, you've successfully stepped into the modern era of application development.

 

You're no longer just saving changes; you're versioning them, collaborating seamlessly, and enjoying the powerful safety net of being able to rollback instantly. This process ensures your ServiceNow applications are built with transparency, stability, and the collaborative rigor they deserve.

 

Happy coding! Now go commit your greatness! 💪

Comments
Dave Bourland
ServiceNow Employee
ServiceNow Employee

Great detail - thank you!

Version history
Last update:
an hour ago
Updated by:
Contributors