- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
2 hours ago
In the early days of ServiceNow, the Update Set was king. Developers would capture changes in update sets, export XML files, and manually migrate them across environments. While functional, this approach is manual, error‑prone, and slow.
Modern enterprises demand speed, stability, and scalability. To achieve this, ServiceNow development must evolve to treat platform code like any other professional software stack - with source control, automated pipelines, and DevOps practices.
-> Limitations of Update Sets
Manual effort: Developers must export/import XML files.
Risk of missing dependencies: Update Sets don’t always capture all related artifacts.
No version control: Difficult to track changes or roll back safely.
Limited collaboration: Multiple developers working on the same feature can cause conflicts.
The goal is to move from a "Push" model (Manual Update Sets) to a "Pull" model (Source Control).
Source Control (GitHub): The single source of truth. No more wondering who changed line 45 of a Script Include.
Orchestration (Jenkins): The "brain" that triggers deployments, runs tests, and validates the build.
App Repo API: ServiceNow's native API that allows external tools to trigger installations and rollbacks.
-> CI/CD with Jenkins & GitHub
1. Source Control with GitHub
Store ServiceNow application code (Scoped Apps, Script Includes, UI Pages, etc.) in GitHub.
Enable branching strategies (feature branches, pull requests, code reviews).
Track history and rollbacks with Git commits.
Integrate with ServiceNow’s Source Control Integration (available for Scoped Apps).
2. Automated Pipelines with Jenkins
Jenkins pipelines can automate:
Build: Validate code quality, run unit tests (e.g., Jasmine framework).
Deploy: Push changes to dev/test/prod environments using ServiceNow APIs.
Change Management: Integrate with ServiceNow DevOps to automatically create/update Change Requests.
Example: A Jenkinsfile can import update sets or trigger ServiceNow DevOps APIs for deployment.
3. ServiceNow DevOps Integration
ServiceNow provides DevOps integrations with GitHub Actions and Jenkins.
Automates Change Request approvals and ensures compliance.
Provides visibility into deployments across environments.
-> Sample Jenkins Pipeline for ServiceNow CI/CD
Here's a simplified Jenkinsfile (Groovy) that demonstrates how you can automate ServiceNow deployments using GitHub as source control and Jenkins as the orchestrator.
pipeline {
agent any
environment {
SERVICENOW_INSTANCE = 'https://yourinstance.service-now.com'
SERVICENOW_USER = credentials('servicenow-username')
SERVICENOW_PASS = credentials('servicenow-password')
APP_SCOPE = 'x_yourcompany_appscope'
}
stages {
stage('Checkout Code') {
steps {
git branch: 'main',
url: 'https://github.com/yourorg/servicenow-app.git'
}
}
stage('Build & Validate') {
steps {
sh '''
# Run unit tests (e.g., Jasmine)
npm install
npm test
'''
}
}
stage('Deploy to Dev') {
steps {
sh '''
curl -u $SERVICENOW_USER:$SERVICENOW_PASS \
-X POST "$SERVICENOW_INSTANCE/api/sn_devops/pipeline/deploy" \
-H "Content-Type: application/json" \
-d '{
"application_scope": "$APP_SCOPE",
"target_environment": "dev"
}'
'''
}
}
stage('Deploy to Test') {
when {
branch 'main'
}
steps {
sh '''
curl -u $SERVICENOW_USER:$SERVICENOW_PASS \
-X POST "$SERVICENOW_INSTANCE/api/sn_devops/pipeline/deploy" \
-H "Content-Type: application/json" \
-d '{
"application_scope": "$APP_SCOPE",
"target_environment": "test"
}'
'''
}
}
}
}
-> What This Pipeline Does
Checkout Code: Pulls the latest ServiceNow app code from GitHub.
Build & Validate: Runs unit tests (e.g., Jasmine framework) to ensure code quality.
Deploy to Dev: Uses ServiceNow DevOps API to deploy the app into the Dev environment.
Deploy to Test: Automatically promotes to Test when changes are merged into main.
-> Key ServiceNow Integrations
Source Control Integration: Scoped apps can be linked directly to GitHub repos.
DevOps APIs: ServiceNow provides REST APIs for pipeline orchestration, deployment, and change management.
Change Automation: Jenkins can trigger ServiceNow DevOps Change Requests automatically, ensuring compliance.
-> Consideration:
The Reward: MTTR (Mean Time to Recovery) drops significantly. If a deployment fails in Test, you can revert to the previous Git commit in seconds.
The Challenge: Handling "Global" scope changes. While Scoped Apps work perfectly with Git, Global changes still require careful Update Set management or the "Global App" conversion.
The Quality Gate: Never allow a deployment to move to Production if the Jasmine Unit Tests or ATF Suites fall below 90% pass rate.
-> Takeaway:
This pipeline shows how ServiceNow development can be treated like any modern software stack:
Code lives in GitHub.
Jenkins automates builds, tests, and deployments.
ServiceNow DevOps APIs ensure governance and compliance.
Thanks,
Ratnakar