Integrations

ServiceNow DevOps CI/CD Spoke Guide

advancedOAuth 2.0 Authorization Code or API Token depending on target platformServiceNow DevOps (CI/CD Spoke)

The ServiceNow DevOps CI/CD Spoke enables organizations to orchestrate continuous integration and delivery pipelines directly within ServiceNow, bridging the gap between development teams and IT operations. This spoke provides real-time visibility into deployment pipelines, automates change approvals based on CI/CD gates, and tracks change velocity metrics to optimize software delivery performance. It's primarily used by DevOps teams, release managers, and IT operations teams who need to integrate their toolchain with ServiceNow's change management and incident processes. The spoke enables bi-directional data flow between ServiceNow and external DevOps tools like Jenkins, GitLab, Azure DevOps, and GitHub Actions, automatically creating change requests when deployments are triggered and updating pipeline status based on ServiceNow approval workflows. It operates within the DevOps module and leverages Integration Hub's orchestration capabilities to provide automated pipeline governance and comprehensive DevOps metrics tracking.

Prerequisites

  • ServiceNow San Diego release or later with DevOps module activated
  • Integration Hub Professional license with flow execution capacity
  • DevOps spoke installed from ServiceNow Store (com.snc.devops.spoke)
  • Admin or integration_admin role in ServiceNow
  • Access to target CI/CD tools (Jenkins, GitLab, Azure DevOps, etc.) with API credentials
  • MID Server installed and operational for on-premises tool integrations
  • Change Management plugin activated (com.snc.change_management.enhanced)

Architecture Overview

The ServiceNow DevOps CI/CD Spoke utilizes Integration Hub flows and subflows to orchestrate pipeline activities, with the official DevOps spoke providing pre-built actions for common CI/CD platforms. Authentication is established through Connection & Credential Aliases stored in the Connections & Credentials module, supporting OAuth 2.0, API keys, and basic authentication depending on the target system. Data flows bi-directionally with outbound calls triggering pipeline executions and inbound webhooks updating ServiceNow records with build status, test results, and deployment outcomes. A MID Server is required when integrating with on-premises CI/CD tools like Jenkins or TFS, as it provides secure connectivity and handles firewall traversal for API communications. The integration respects standard API rate limits of target platforms, with Jenkins typically allowing 100 requests per hour per API key and GitLab supporting 2000 requests per hour for authenticated users, while ServiceNow's own REST API limits apply to inbound webhook traffic at 5000 requests per hour per instance.

Sourdough
Chrome Extension

Sourdough: ServiceNow Monitoring and Analytics

A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.

Instance HealthGraphs & ChartsAPI HealthDeveloper ToolsQuick SearchInstance Switcher
Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Implementation Steps

1

Install and configure the ServiceNow DevOps spoke from ServiceNow Store

Navigate to System Applications > All Available Applications > All and search for 'DevOps' to locate the official ServiceNow DevOps spoke (com.snc.devops.spoke). Click Install and wait for the installation to complete, which typically takes 3-5 minutes and includes subflows for Jenkins, GitLab, Azure DevOps, and GitHub integrations. After installation, navigate to DevOps > Administration > Properties to configure global DevOps settings including default change request assignment groups and approval workflows. Verify the installation by checking that new tables like devops_pipeline, devops_deployment, and devops_artifact are created and accessible.

2

Create Connection and Credential records for target CI/CD platform

Navigate to Connections & Credentials > Connections and click New to create a connection record for your CI/CD tool (Jenkins, GitLab, etc.). Set the Connection URL to your platform's base API URL (e.g., https://jenkins.company.com/api or https://gitlab.com/api/v4) and select the appropriate authentication type. Create a corresponding Credential record by navigating to Connections & Credentials > Credentials, selecting the matching credential type (Basic Auth for Jenkins, OAuth 2.0 for GitLab), and entering your API credentials. Test the connection using the Test Connection functionality to ensure proper authentication and network connectivity through your MID Server if required.

ServiceNow Script
// Test connection script for validation
var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
rm.setEndpoint('https://jenkins.company.com/api/json');
rm.setBasicAuth('username', 'api_token');
var response = rm.execute();
gs.info('Connection test result: ' + response.getStatusCode());
3

Configure DevOps pipeline registration and discovery

Navigate to DevOps > Pipeline > Pipeline Registration and click New to register your CI/CD pipelines with ServiceNow. Enter the pipeline name, select the source system connection created in the previous step, and specify the pipeline identifier used in your CI/CD tool (job name for Jenkins, project ID for GitLab). Configure pipeline discovery by setting up a scheduled job under DevOps > Administration > Pipeline Discovery that automatically syncs pipeline definitions and execution history. Set the discovery frequency to run every 15 minutes during business hours to balance real-time visibility with API rate limit considerations. Enable change integration by checking the 'Create Change Requests' option and mapping pipeline stages to change request states.

ServiceNow Script
// Pipeline discovery script example
var pipeline = new GlideRecord('devops_pipeline');
pipeline.initialize();
pipeline.name = 'Production Deployment Pipeline';
pipeline.source_system = sys_connection_id;
pipeline.external_id = 'prod-deploy-job';
pipeline.change_integration_enabled = true;
pipeline.insert();
4

Set up webhook endpoints for real-time pipeline status updates

Navigate to System Web Services > Scripted REST APIs and create a new API called 'DevOps Pipeline Webhook' with the resource path '/devops/pipeline/status'. Implement POST and PUT methods to handle incoming webhook payloads from your CI/CD tools containing build status, test results, and deployment information. Configure your CI/CD platform to send webhooks to the ServiceNow endpoint URL (https://instance.service-now.com/api/company/devops/pipeline/status) with proper authentication headers. Set up payload parsing logic to extract relevant information like build number, status, commit SHA, and deployment environment, then update corresponding devops_deployment and change_request records.

ServiceNow Script
(function process(request, response) {
    var payload = request.body.data;
    var deployment = new GlideRecord('devops_deployment');
    deployment.addQuery('external_build_id', payload.build_id);
    deployment.query();
    if (deployment.next()) {
        deployment.status = payload.status;
        deployment.end_time = new GlideDateTime();
        deployment.update();
    }
    response.setStatus(200);
    return 'Success';
})(request, response);
5

Configure change approval automation with CI/CD gates

Navigate to Change > Change Request > Approval Rules and create approval rules that integrate with CI/CD pipeline gates. Set up conditions that automatically approve normal changes when all pipeline quality gates pass (unit tests, security scans, integration tests) and require manual approval when gates fail or for emergency changes. Configure the DevOps spoke's change approval subflow by going to Process Automation > Flow Designer and customizing the 'DevOps Change Approval' flow to include your organization's specific approval criteria. Set up approval delegation rules that automatically assign approvals to the appropriate teams based on deployment target (development, staging, production) and application criticality level.

ServiceNow Script
// Change approval automation script
var change = new GlideRecord('change_request');
change.addQuery('correlation_id', pipeline_execution_id);
change.query();
if (change.next()) {
    if (all_gates_passed && change.risk == 'low') {
        change.approval = 'approved';
        change.state = 'authorized';
        change.update();
    }
}
6

Set up DevOps metrics dashboards and reporting

Navigate to DevOps > Dashboards > Pipeline Metrics to configure pre-built dashboards that track deployment frequency, lead time, change failure rate, and recovery time metrics. Create custom Performance Analytics widgets by going to Performance Analytics > Data Collectors and setting up collectors for devops_deployment and devops_pipeline tables to gather historical trend data. Configure automated metric calculations using scheduled scripts that compute DORA metrics (Deployment Frequency, Lead Time for Changes, Change Failure Rate, Time to Recovery) on a daily basis. Set up email notifications for stakeholders by creating notification rules under System Notification > Email > Notifications that trigger when deployment failure rates exceed thresholds or when lead times increase significantly.

ServiceNow Script
// DORA metrics calculation script
var calculator = new GlideRecord('devops_deployment');
calculator.addQuery('created_on', '>=', gs.daysAgoStart(30));
calculator.query();
var deploymentCount = calculator.getRowCount();
var failureRate = new GlideAggregate('devops_deployment');
failureRate.addQuery('status', 'failed');
failureRate.addQuery('created_on', '>=', gs.daysAgoStart(30));
failureRate.addAggregate('COUNT');
failureRate.query();
var changeFailureRate = failureRate.next() ? (failureRate.getAggregate('COUNT') / deploymentCount) * 100 : 0;
7

Implement deployment tracking and artifact management

Navigate to DevOps > Deployments > Configuration and enable deployment tracking to automatically create deployment records when pipelines execute. Configure artifact management by setting up relationships between code commits, build artifacts, and configuration items in the CMDB through the DevOps > Artifacts interface. Set up deployment impact analysis by linking deployments to affected CIs and enabling automatic incident correlation when deployment-related issues occur. Enable deployment rollback capabilities by configuring the rollback subflow in Flow Designer to trigger pipeline rollback jobs and update change request states accordingly.

ServiceNow Script
// Deployment record creation
var deployment = new GlideRecord('devops_deployment');
deployment.initialize();
deployment.pipeline = pipeline_sys_id;
deployment.environment = 'production';
deployment.version = build_version;
deployment.change_request = change_sys_id;
deployment.configuration_items = affected_ci_list;
deployment.status = 'in_progress';
deployment.start_time = new GlideDateTime();
var deployment_id = deployment.insert();
8

Test end-to-end integration and configure monitoring

Execute a complete test deployment through your CI/CD pipeline to verify that change requests are automatically created, approvals are processed according to configured rules, and deployment status updates are received in ServiceNow. Navigate to DevOps > Pipeline Executions to monitor the test execution and verify that all data flows correctly between your CI/CD tools and ServiceNow. Set up integration monitoring by creating custom health checks under DevOps > Administration > Health Monitoring that regularly test API connectivity and webhook delivery. Configure alerting for integration failures by setting up Event Management rules that create incidents when webhook deliveries fail or when pipeline discovery jobs encounter errors.

ServiceNow Script
// Integration health check script
var healthCheck = new sn_ws.RESTMessageV2();
healthCheck.setHttpMethod('GET');
healthCheck.setEndpoint(pipeline_api_endpoint + '/health');
healthCheck.setRequestHeader('Authorization', 'Bearer ' + api_token);
var response = healthCheck.execute();
if (response.getStatusCode() != 200) {
    gs.eventQueue('devops.integration.failure', null, 'Pipeline API health check failed: ' + response.getBody());
}

Common Use Cases

Automated Change Approval for Production Deployments

Pipeline executions automatically create change requests in ServiceNow when deploying to production environments, with approval workflows that consider CI/CD gate results, security scan outcomes, and deployment risk assessments. Change requests are auto-approved for low-risk deployments that pass all quality gates, while high-risk or gate-failed deployments require manual CAB approval. The system tracks deployment success rates and automatically adjusts risk scoring based on historical failure patterns and application criticality. Integration provides full audit trails linking code changes, approvals, and deployment outcomes for compliance reporting.

DevOps Metrics Dashboard and DORA Tracking

Real-time dashboards display deployment frequency, lead time for changes, change failure rate, and mean time to recovery across all applications and teams. Historical trend analysis helps identify bottlenecks in the delivery pipeline and tracks improvement initiatives over time. Executive dashboards provide portfolio-level views of DevOps maturity and delivery performance comparisons between different development teams. Automated alerts notify stakeholders when metrics deviate from established thresholds or when deployment failure rates spike above acceptable levels.

Incident Correlation with Deployment Events

When incidents are reported, ServiceNow automatically correlates them with recent deployments to the affected configuration items, enabling faster root cause identification. The system maintains deployment history with artifact versions, allowing support teams to quickly identify which code changes might have introduced issues. Automated rollback workflows can be triggered from incident records, initiating pipeline rollback jobs and updating change request states accordingly. Deployment impact analysis shows which CIs and business services are affected by each deployment, helping prioritize incident response efforts.

Security and Compliance Gate Integration

CI/CD pipelines integrate with ServiceNow Security Operations to enforce security scanning requirements and vulnerability management policies before production deployments. Failed security scans automatically create vulnerability records and block deployment progression until remediation is complete. Compliance checks verify that all required approvals, testing phases, and documentation requirements are met before allowing deployments to proceed. The system maintains detailed audit logs of all security gate results and approval decisions for regulatory compliance reporting.

Multi-Environment Deployment Orchestration

Complex deployment workflows coordinate releases across multiple environments (dev, test, staging, production) with automated promotion criteria and approval gates between stages. Environment-specific configuration management ensures proper settings and secrets are applied during deployments while maintaining security boundaries. Deployment scheduling integrates with ServiceNow's change calendar to avoid conflicts with maintenance windows and other planned activities. Rollback coordination across environments ensures consistent application states when deployment issues require reverting changes across the entire pipeline.

Troubleshooting

Pipeline webhook payloads received but deployment records not created

Check the System Logs > REST API logs for parsing errors in your scripted REST API endpoint. Verify that the webhook payload structure matches your parsing logic by examining actual payloads in the sys_rest_message table. Ensure that required fields like external_build_id and pipeline_sys_id are properly extracted from the payload. Test payload parsing in a background script first, then update your webhook endpoint code to handle variations in payload structure from different CI/CD tools.

Change requests created but not automatically approved despite passing CI/CD gates

Navigate to Change > Approval Rules and verify that your approval conditions properly reference the CI/CD gate status fields on the change request record. Check that the pipeline execution data is correctly updating these fields by examining the change request form and related lists for deployment information. Review the approval engine logs under System Logs > Approval Engine to identify why automatic approval rules are not triggering. Ensure that the approval rule order and conditions don't conflict with other existing approval workflows in your instance.

DevOps metrics dashboards showing incomplete or inaccurate data

Verify that pipeline discovery jobs are running successfully by checking DevOps > Administration > Scheduled Jobs for execution history and error logs. Ensure that all CI/CD tools are properly sending webhook notifications by testing webhook delivery from your pipeline configurations. Check Performance Analytics data collectors under PA > Data Collectors to confirm they're processing devops table data correctly and running on schedule. Validate metric calculations by running manual queries against devops_deployment and devops_pipeline tables to compare with dashboard results.

MID Server connectivity issues preventing on-premises CI/CD integration

Navigate to MID Server > Servers and verify that your MID Server shows as 'Up' status and has processed recent ECC queue messages. Test direct connectivity from the MID Server host to your CI/CD tool APIs using curl or similar tools to isolate network issues. Check MID Server logs for SSL certificate validation errors when connecting to HTTPS endpoints and update certificate stores if necessary. Verify that firewall rules allow outbound HTTPS connections from the MID Server to your CI/CD tool URLs and that proxy configurations are correctly set in the MID Server config.xml file.

Pipeline executions timing out during ServiceNow API calls

Check your CI/CD tool's timeout configurations and increase them to accommodate ServiceNow API response times, especially during peak usage periods. Navigate to System Web Services > REST API > API Metrics to identify slow-performing ServiceNow APIs and optimize queries or increase instance resources if needed. Implement retry logic in your pipeline scripts to handle temporary ServiceNow unavailability or rate limiting. Consider using asynchronous webhook patterns instead of synchronous API calls for non-critical status updates to avoid blocking pipeline execution.

Duplicate deployment records created from multiple webhook deliveries

Implement idempotency checks in your webhook handling code by using unique external identifiers (build IDs, commit SHAs) to prevent duplicate record creation. Add database constraints or before-insert business rules that validate uniqueness of external_build_id fields. Configure your CI/CD tools to include unique correlation IDs in webhook payloads and use these for deduplication logic. Review webhook delivery logs in your CI/CD platform to identify why multiple deliveries are occurring and adjust retry mechanisms if necessary.

Pro Tips

  • Implement custom business rules on devops_deployment table to automatically link deployments to related incidents and problems based on timing correlation and affected CIs, providing faster root cause analysis during outages. Use deployment time windows and CI relationships to build sophisticated correlation logic that can identify deployment-related issues even when they manifest hours after the actual deployment.
  • Set up advanced Performance Analytics breakdowns that segment DevOps metrics by application portfolio, team, technology stack, and deployment type to identify specific improvement opportunities. Create custom PA indicators that combine ServiceNow data with external tool metrics to provide comprehensive DevOps maturity scoring across your organization.
  • Configure dynamic approval workflows that adjust change approval requirements based on deployment risk scoring, historical success rates, and real-time monitoring data from APM tools. Use ServiceNow's Flow Designer to create conditional approval paths that automatically escalate to different approval groups based on deployment impact analysis and business service criticality.
  • Implement webhook payload encryption and signature validation in your scripted REST APIs to ensure secure communication between CI/CD tools and ServiceNow, especially when handling sensitive deployment information. Store webhook secrets in encrypted credential records and validate message integrity before processing pipeline status updates.
  • Create custom DevOps health monitoring dashboards that track integration uptime, API response times, webhook delivery success rates, and pipeline discovery job performance to proactively identify and resolve integration issues. Set up automated health checks that test end-to-end integration flows and alert administrators before business users notice problems.

Known Limitations

  • The DevOps spoke requires Integration Hub Professional licensing and consumes flow execution capacity with each pipeline interaction, potentially requiring capacity planning for high-volume deployment environments. Each webhook delivery and pipeline discovery operation counts against your monthly flow execution quota, which may require upgrading to higher-tier licenses for organizations with frequent deployments.
  • Real-time pipeline status updates depend on reliable webhook delivery from CI/CD tools, and temporary network issues or tool outages can cause data synchronization gaps in ServiceNow. The spoke includes retry mechanisms, but extended outages may require manual data reconciliation or re-triggering of pipeline discovery jobs to maintain accurate deployment tracking.
  • Performance Analytics for DevOps metrics requires the PA plugin and additional licensing, and historical data collection is limited by PA data retention policies and aggregation capabilities. Complex metric calculations across large deployment datasets may require custom scheduled scripts and can impact instance performance during processing windows.

Frequently Asked Questions

Can the DevOps spoke integrate with custom or proprietary CI/CD tools not explicitly supported?

Yes, the spoke's generic REST API actions and webhook capabilities can integrate with any CI/CD tool that supports REST APIs and webhook notifications. You'll need to create custom subflows in Integration Hub that map your tool's API responses to ServiceNow's devops table structure. The spoke provides template subflows and comprehensive API documentation to help build integrations with unsupported tools, though you'll miss some pre-built functionality available for Jenkins, GitLab, and Azure DevOps.

How does the DevOps spoke handle deployment rollbacks and their impact on change management?

The spoke includes rollback subflows that can trigger rollback jobs in your CI/CD tools and automatically update change request states and deployment records. When a rollback occurs, the system creates new deployment records with rollback flags and links them to the original failed deployment for audit purposes. Change requests are updated to reflect the rollback status, and approval workflows can be configured to require additional approvals for rollback operations depending on their impact scope and timing.

What level of customization is possible for DevOps metrics and dashboard reporting?

The spoke provides extensive customization options through Performance Analytics widgets, custom business rules on devops tables, and Integration Hub flows that can calculate custom metrics. You can create organization-specific DORA metric variations, build custom dashboards that combine DevOps data with ITSM metrics, and implement automated reporting that integrates with external business intelligence tools. The underlying devops tables can be extended with custom fields to capture additional metrics specific to your deployment processes and business requirements.

How does the integration handle security and sensitive data in CI/CD pipelines?

The spoke stores all authentication credentials in ServiceNow's encrypted Credential records and supports industry-standard authentication methods like OAuth 2.0 and API tokens. Webhook payloads can be configured with signature validation and encryption to ensure data integrity during transmission. Sensitive deployment information like environment configurations and secrets are handled through secure credential passing mechanisms, and access to DevOps data is controlled through standard ServiceNow role-based security and ACL configurations.

Can the DevOps spoke manage deployments across hybrid cloud and on-premises environments?

Yes, the spoke supports hybrid deployments through MID Server connectivity for on-premises tools and direct API integration for cloud-based CI/CD platforms. You can configure multiple connection records for different environments and orchestrate complex deployment workflows that span multiple infrastructure types. The spoke's environment management capabilities allow you to define deployment targets, track environment-specific configurations, and maintain separate approval workflows for different infrastructure tiers while providing unified visibility across your entire deployment landscape.

What happens to DevOps integration data during ServiceNow instance upgrades or cloning?

DevOps tables and configuration data are preserved during upgrades, but you should verify that webhook endpoints and API credentials remain functional after the upgrade process. For instance cloning, webhook URLs need to be updated in your CI/CD tools to point to the new instance, and any encrypted credentials may need to be reconfigured. The spoke includes data preservation scripts and post-upgrade health checks to validate integration functionality, and ServiceNow provides upgrade guides specific to DevOps module changes in each release.

How can teams measure ROI and business value from implementing the DevOps spoke integration?

The spoke provides built-in metrics for deployment frequency, lead time reduction, and change failure rate improvements that can be benchmarked against industry standards and pre-implementation baselines. You can track operational efficiency gains through reduced manual approval processing, faster incident resolution through deployment correlation, and improved compliance through automated audit trails. Custom dashboards can combine DevOps metrics with business KPIs like mean time to market, customer satisfaction scores, and revenue impact of faster feature delivery to demonstrate concrete business value from the integration investment.

Test Your Knowledge

Quick 3-question quiz — see how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue