How to Automated Deployments using Build and Release Pipelines

Brian104
Tera Expert

Our team is looking at how to automate deployment from dev to test instances using Azure Pipelines, Git Pipelines, etc. Are there any API endpoints available to initiate a "Publish" and/or "Install" command on a ServiceNow instance? Basically, what we’re trying to create is a build pipeline that gets triggered by a pull request and then invoke the publish or install commands via a REST API call. This is basically what we do on the full stack development side of things (change is made, pull request approved, test is built). QA and Prod require a release approval.

Thanks!

6 REPLIES 6

Brian104
Tera Expert

This is great Dale!  After some initial investigation, it looks like to say publish an application I would need to do something like the following:

In ServiceNow:

  1. Install the Integration Hub Stater Pack
  2. Create a CI/CD credential to my repo.
  3. Create a Scripted REST API that calls the "Publish Application With Scope" subflow provided

In Jenkins, ADO, Github, etc:

  1. Create the build pipeline
  2. Trigger it manually
  3. Call the Scripted REST API  endpoint with required inputs (i.e.scope, credential_alias, instance_url)

I'm going to try this and post my results.   This won't work in a PDI since you can't publish to the store, so my goal is to at least hit the endpoint and get the error from the subflow.

Brian104
Tera Expert

Using this newfound knowledge, I've started a draft article on a software development lifecycle approach:  https://community.servicenow.com/community?id=community_article&sys_id=ed60fb72db9f015008bbdb85ca961...