How Can I integrate Servicenow with GitLab

Sagar24
Tera Contributor

I have a requirement to integrate between servicenow devops with GitLab and we have installed gitlab spoke for that and also oauth credentials created in the instance. Now, How Can I move forward?

I'm new to this integration and I have referred few communities not much of use. What could be the next?, primary requirement is to create at least project and branch in gitlab using integration

 

Thanks

4 REPLIES 4

Hitoshi Ozawa
Giga Sage
Giga Sage

It's first necessary to decide on what to do with GitLab.

Is it to keep ServiceNow scripts and resources? Or it is to keep track of events on GitLab.

If it is to keep resource developed on ServiceNow, refer to App engine or Studio.

https://docs.servicenow.com/bundle/rome-devops/page/product/enterprise-dev-ops/concept/gitlab-integr...

If it's to keep track of events on GiLab, then use GitLab spoke. It's necessary to decide on which event to integrate. Example, create change tickets on ServiceNow, use ServiceNow's approval.

https://docs.gitlab.com/ee/user/project/integrations/servicenow.html

Hitoshi,

Thanks for your response. The main aim is to move/deploy code from dev to test. We tried linking source control to gitlab repository but the client want something using gitlab spoke or a flow designer

Vishal36
Mega Guru

Hi @Sagar24 

You’re off to a good start. After setting up the GitLab Spoke and OAuth, you’ll use Flow Designer in ServiceNow to automate the actions.

Here’s how to move forward:

  • In Flow Designer, create a new flow and choose GitLab as the action type.
  • Use the “Create Project” or “Create Branch” action provided by the Spoke.
  • Fill in the required inputs like project name or repository path.
  • Test the flow and verify the result in GitLab.

If you need more flexibility, OpsHub Integration Manager can help by:

  • Keeping both systems in sync without needing to manually build every flow
  • Integrate issues and status transition bi-directionally, including comments, attachments, links
  • No-code easy to use UI to enable integration at lightning speed

Hope it helps!

anshulkicha
Mega Contributor

You can connect ServiceNow to GitLab using options such as webhooks, REST API, or middleware tools like DevOps Configurator.By setting up a CI/CD pipeline in GitLab, you can initiate ServiceNow workflows, such as incident creation, via API calls. Alternatively, consider using the GitLab Plugin for ServiceNow to keep everything in sync. Here are some essential steps to follow:

1. API Integration: Leverage ServiceNow’s REST API for seamless, two-way communication.

2. Webhooks: Set up GitLab webhooks to send events, such as commits, directly to ServiceNow.

3. DevOps Configurator: Utilize ServiceNow’s built-in DevOps capabilities to simplify the setup process.