Search code examples
gitlabjiragitlab-cijira-rest-api

JIRA approval to GITLAB pipeline


We want to integrate JIRA with GITLAB for the approval. When CICD Pipeline runs it deploys to DEV/QA and when it deploys to PROD we want to check two things

  1. One Merge request approval by a manager/code owner
  2. It has be approved by a business user.

We dont want the business user to get access for gitlab and set up an approval there.When JIRA ticket is marked as an approved by him we want the pipeline to run .

Is this scenario possible by using like JIRA API or is there a better way to do this?

Thanks


Solution

  • As I'm aware there is no such built in functionality, but you can build a bot to do this.

    Basically you write an application which listens to a JIRA webhook which is configured to trigger if an issue is updated.
    The bot will then trigger the actions for you in Gitlab. Depending on your setup there it could set approvals ( incase you are using the deployment branch model ) or trigger the deployment pipeline after it is already merged by the code owner. This is done using the GitlabAPIs
    Finally you can update the issue in JIRA using the API with the status of the deployment