{"id":49516,"date":"2025-05-28T02:01:02","date_gmt":"2025-05-28T02:01:02","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=49516"},"modified":"2025-05-28T02:01:02","modified_gmt":"2025-05-28T02:01:02","slug":"gitlab-integration-with-servicenow","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/gitlab-integration-with-servicenow\/","title":{"rendered":"Gitlab Integration with Servicenow"},"content":{"rendered":"\n<p>in <strong>GitLab 18.x Cloud<\/strong>, you can absolutely <strong>integrate with ServiceNow<\/strong> to support:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2705 Change Management workflows<\/li>\n\n\n\n<li>\u2705 Incident Management<\/li>\n\n\n\n<li>\u2705 Automated Service Request Fulfillment<\/li>\n<\/ul>\n\n\n\n<p>However, this requires the use of <strong>GitLab\u2019s ServiceNow DevOps Integration App<\/strong>, available via the <strong>Atlassian Marketplace<\/strong> and <strong>ServiceNow Store<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 GitLab \u2194 ServiceNow Integration (as of GitLab 18.x)<\/h2>\n\n\n\n<p>GitLab provides <strong>official, bi-directional integration<\/strong> with ServiceNow DevOps for <strong>enterprise-level DevSecOps automation<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 1. Change Management Workflow Integration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 What You Can Do:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatically create <strong>Change Requests (CRs)<\/strong> in ServiceNow when a <strong>pipeline runs<\/strong> or <strong>code is merged<\/strong> in GitLab.<\/li>\n\n\n\n<li>Require <strong>ServiceNow approval before deployment<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde0 Example Use Case:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>MR merged to <code>main<\/code> \u2192 triggers <code>Pre-approved Change Request<\/code> in ServiceNow \u2192 waits for approval \u2192 continues deployment.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 How to Set Up:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In ServiceNow:\n<ul class=\"wp-block-list\">\n<li>Install <strong>ServiceNow DevOps plugin<\/strong><\/li>\n\n\n\n<li>Install <strong>GitLab Integration App<\/strong> from ServiceNow Store<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In GitLab:\n<ul class=\"wp-block-list\">\n<li>Configure a <strong>WebHook<\/strong> or use <strong>Custom GitLab CI Job<\/strong> to send pipeline events to ServiceNow.<\/li>\n\n\n\n<li>Optionally configure via GitLab Compliance Center \u2192 Pipeline Execution Policies<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>You can also configure a <strong>change control gate<\/strong> in <code>.gitlab-ci.yml<\/code>:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">approve_change_request:\n  stage: deploy\n  <span class=\"hljs-attr\">script<\/span>:\n    - curl -X POST https:<span class=\"hljs-comment\">\/\/servicenow\/api\/trigger-change<\/span>\n  rules:\n    - <span class=\"hljs-keyword\">if<\/span>: <span class=\"hljs-string\">'$CI_COMMIT_BRANCH == \"main\"'<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 2. Incident Management Integration<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 What You Can Do:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Auto-create <strong>incidents in ServiceNow<\/strong> when pipelines or deployments fail.<\/li>\n\n\n\n<li>Link GitLab issues\/MRs to <strong>ServiceNow incident records<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 Setup:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>ServiceNow DevOps Events API<\/strong><\/li>\n\n\n\n<li>Configure a GitLab <strong>WebHook or CI job<\/strong> to send failure events to ServiceNow<\/li>\n\n\n\n<li>Tag ServiceNow incidents with commit\/MR metadata for traceability<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 3. Automate Service Request Fulfillment<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 What You Can Do:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use GitLab pipelines to <strong>fulfill service catalog requests<\/strong> (e.g., provision infra, deploy apps)<\/li>\n\n\n\n<li>ServiceNow \u2192 GitLab triggers via <strong>MID server or API connector<\/strong><\/li>\n\n\n\n<li>GitLab \u2192 ServiceNow updates back with logs\/status<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 Setup:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Define catalog workflows in ServiceNow<\/li>\n\n\n\n<li>Trigger GitLab pipelines via:\n<ul class=\"wp-block-list\">\n<li>API calls (<code>POST \/projects\/:id\/trigger\/pipeline<\/code>)<\/li>\n\n\n\n<li>Custom catalog items with <strong>Flow Designer<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Summary Table (GitLab 18.x Cloud)<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>Supported<\/th><th>Setup Method<\/th><\/tr><\/thead><tbody><tr><td>Change Management<\/td><td>\u2705 Yes<\/td><td>GitLab DevOps App in ServiceNow + WebHooks<\/td><\/tr><tr><td>Incident Management<\/td><td>\u2705 Yes<\/td><td>GitLab WebHooks + ServiceNow Events API<\/td><\/tr><tr><td>Service Request Fulfillment<\/td><td>\u2705 Yes<\/td><td>Catalog Items + GitLab pipeline triggers<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\ude80 Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.gitlab.com\/ee\/user\/project\/integrations\/servicenow.html\" target=\"_blank\" rel=\"noopener\">GitLab + ServiceNow Docs<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/store.servicenow.com\/sn_appstore_store.do#!\/store\/application\/4b76387b1b34e010a99a3876bc4bcb2f\" target=\"_blank\" rel=\"noopener\">ServiceNow DevOps Store App<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Here\u2019s a complete, <strong>production-ready <code>.gitlab-ci.yml<\/code> example<\/strong> that integrates with <strong>ServiceNow<\/strong> to:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\ud83d\udd27 Create a <strong>Change Request<\/strong> via API<\/li>\n\n\n\n<li>\ud83d\udd52 Wait for ServiceNow <strong>approval<\/strong><\/li>\n\n\n\n<li>\ud83d\ude80 Proceed with deployment <strong>only if approved<\/strong><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You have a <strong>ServiceNow DevOps integration<\/strong> set up.<\/li>\n\n\n\n<li>You have a <strong>ServiceNow API endpoint<\/strong> to:\n<ul class=\"wp-block-list\">\n<li>Create Change Requests (<code>\/api\/devops\/create-change<\/code>)<\/li>\n\n\n\n<li>Poll status (<code>\/api\/devops\/change-status<\/code>)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>You have a <strong>valid bearer token<\/strong> (stored as GitLab CI variable: <code>SERVICENOW_TOKEN<\/code>)<\/li>\n<\/ul>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/b7a7f9f54f9784c35bec02ece9d0dce5.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>in GitLab 18.x Cloud, you can absolutely integrate with ServiceNow to support: However, this requires the use of GitLab\u2019s ServiceNow DevOps Integration App, available via the Atlassian Marketplace and ServiceNow&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-49516","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/49516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=49516"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/49516\/revisions"}],"predecessor-version":[{"id":49517,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/49516\/revisions\/49517"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=49516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=49516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=49516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}