Get started with Jira Service Management for admins
Your first stop for learning how to get started with Jira Service Management.
The deployment gating feature allows you to bring change requests from GitLab to Jira Service Management for approval. Once set up, any GitLab deployments to your selected environments are automatically sent to approvers in Jira Service Management and will only deploy if approved.
Before you can use deployment gating with GitLab, you must first:
You should also be on either GitLab Premium or Ultimate plans to complete the settings required for enabling deployment gating.
At this point, your service project is ready to connect to GitLab repositories.
When enabling GitLab during deployment tracking, you’ve provided a Service ID and connected your services to GitLab. To enable deployment gating:
When enabling GitLab during deployment tracking, you’ve provided a Service ID and connected your services to GitLab. To enable deployment gating:
Log in to your GitLab. On the left sidebar, select Search or go to and find your project.
Select Settings > Integrations.
Select GitLab for Jira Cloud app.
You’ll see the Service ID field which you’ve filled previously for deployment tracking. Now you’ll see additional options under Deployment Gating.
Select Enable deployment gating.
In the Environment Tiers field, enter the name of the environment you wish to enable deployment gating for. You can enter production, staging, testing, and development as environment names. Use a comma between each environment name to add multiple. Please use lowercase letters only and avoid typos.
Select Save changes.
Go back to you service project and navigate to Project settings > Change management.
In the Deployment pipelines tab, under Deployment gating select Allow or prevent deployments using statuses in the change request workflow. Read more about setting up deployment gating.
Now, your project is ready for the deployment gating. To complete the setting you’ll need to enter your personal access token in the Service account token field.
To create a service token in GitLab, you must first create a personal access token. This will authenticate the service account token, which we’ll then use to manage GitLab deployment through approvals and rejections given to changes in Jira Service Management.
To create a personal access token, you must first create a service account user in GitLab. Read how to create a service account in GitLab.
Add the service account you created to a project using the personal access token. Read how to add service account as a member to a group or project.
Then, add the service account to protected environments in GitLab. Read how to add service account to protected environments.
Finally, generate a Service account token in GitLab using your personal access token. Read how to create acces token for service account.
Go back to you service project in Jira Service Management. Navigate to Project settings > Change managementagain.
Paste your generated token into the Service Accounts Token field.
Select Save to activate deployment gating in GitLab.
Go back to your GitLab and select your project under groups.
Select Settings > CI/CD.
Expand Protected environments and select Protect an environment.
Add a new protected environment, like, staging.
From Allowed to deploy select who is allowed to deploy to this environment. For example, Developers+Maintainers.
Select the service account you created earlier as an approver in the Approvers field.
Select Protect to save the changes.
You can use the examples below to send requests to the following APIs.
1
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "name=<name_of_your_choice>&username=<username_of_your_choice>" "<https://gitlab.com/api/v4/groups/<group_id>/service_accounts"
1
2
3
4
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--data "user_id=<service_account_id>&access_level=30" "https://gitlab.com/api/v4/groups/<group_id>/members"
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--data "user_id=<service_account_id>&access_level=30" "https://gitlab.com/api/v4/projects/<project_id>/members"
1
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.com/api/v4/groups/<group_id>/service_accounts/<service_account_id>/personal_access_tokens" --data "scopes[]=api,read_user,read_repository" --data "name=service_accounts_token"
Was this helpful?