debian-mirror-gitlab/doc/integration/jira/dvcs/index.md

152 lines
7.4 KiB
Markdown
Raw Normal View History

2021-04-29 21:17:54 +05:30
---
2022-11-25 23:54:43 +05:30
stage: Manage
2021-10-27 15:23:28 +05:30
group: Integrations
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2021-04-29 21:17:54 +05:30
---
2021-06-08 01:23:25 +05:30
# Jira DVCS connector **(FREE)**
2021-04-29 21:17:54 +05:30
2023-06-20 00:43:36 +05:30
WARNING:
The Jira DVCS connector for Jira Cloud was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/362168) in GitLab 15.1
and is planned for removal in 16.0. Use the [GitLab for Jira Cloud app](../connect-app.md) instead.
2021-04-29 21:17:54 +05:30
Use the Jira DVCS (distributed version control system) connector if you self-host
2023-06-20 00:43:36 +05:30
your Jira instance and want to sync information between GitLab and Jira.
If you're using the Jira DVCS connector with Jira Cloud, [migrate to the GitLab for Jira Cloud app](#migrate-to-the-gitlab-for-jira-cloud-app).
2021-04-29 21:17:54 +05:30
When you configure the Jira DVCS connector, make sure your GitLab and Jira instances
are accessible.
- **Self-managed GitLab**: Your GitLab instance must be accessible by Jira.
- **Jira Server**: Your network must allow access to your instance.
2023-03-04 22:38:38 +05:30
2021-12-11 22:18:48 +05:30
## Smart Commits
2021-04-29 21:17:54 +05:30
2023-06-20 00:43:36 +05:30
When connecting GitLab and Jira with the Jira DVCS connector, you can process your Jira issues with
special commands called [Smart Commits](https://support.atlassian.com/jira-software-cloud/docs/process-issues-with-smart-commits/).
With Smart Commits, you can:
2021-04-29 21:17:54 +05:30
- Comment on issues.
- Record time-tracking information against issues.
- Transition issues to any status defined in the Jira project's workflow.
2023-06-20 00:43:36 +05:30
Commands must be in the first line of the commit message. For more information about how Smart Commits work and what commands are available
for use, see the [Atlassian documentation](https://support.atlassian.com/jira-software-cloud/docs/process-issues-with-smart-commits/).
2021-04-29 21:17:54 +05:30
2023-06-20 00:43:36 +05:30
For Smart Commits to work, the GitLab user must have a corresponding
Jira user with the same email address or username.
2021-04-29 21:17:54 +05:30
2021-06-08 01:23:25 +05:30
### Smart Commit syntax
2023-06-20 00:43:36 +05:30
Smart Commits must follow this pattern:
2021-06-08 01:23:25 +05:30
```plaintext
<ISSUE_KEY> <ignored text> #<command> <optional command parameters>
```
Some examples:
2021-12-11 22:18:48 +05:30
- Add a comment to a Jira issue: `KEY-123 fixes a bug #comment Bug is fixed.`
- Record time tracking: `KEY-123 #time 2w 4d 10h 52m Tracking work time.`
- Close an issue: `KEY-123 #close Closing issue`
2021-06-08 01:23:25 +05:30
2023-06-20 00:43:36 +05:30
A Smart Commit message must not span more than one line (no carriage returns), but
2021-12-11 22:18:48 +05:30
you can still perform multiple actions in a single commit. For example:
2021-06-08 01:23:25 +05:30
2021-12-11 22:18:48 +05:30
- Add time tracking, add a comment, and transition to **Closed**:
```plaintext
KEY-123 #time 2d 5h #comment Task completed ahead of schedule #close
```
- Add a comment, transition to **In-progress**, and add time tracking:
```plaintext
KEY-123 #comment started working on the issue #in-progress #time 12d 5h
```
2021-06-08 01:23:25 +05:30
2021-04-29 21:17:54 +05:30
## Configure a GitLab application for DVCS
2023-06-20 00:43:36 +05:30
For projects in a single group, you should create a [group application](../../oauth_provider.md#create-a-group-owned-application).
For projects across multiple groups, you should create a new user account in GitLab for Jira integration work only.
A separate account ensures regular account maintenance does not affect your integration.
If a separate user account or group application is not possible, you can set up this integration
as an [instance-wide application](../../oauth_provider.md#create-an-instance-wide-application)
or with a [user-owned application](../../oauth_provider.md#create-a-user-owned-application).
1. Go to the [appropriate **Applications** section](../../oauth_provider.md).
1. In the **Name** text box, enter a descriptive name for the integration (for example, `Jira`).
1. In the **Redirect URI** text box, enter the generated **Redirect URL** from
[linking GitLab accounts](https://confluence.atlassian.com/adminjiraserver/linking-gitlab-accounts-1027142272.html).
1. In **Scopes**, select `api` and clear any other checkboxes.
The DVCS connector requires a **write-enabled** `api` scope to automatically create and manage required webhooks.
2021-04-29 21:17:54 +05:30
1. Select **Submit**.
2021-12-11 22:18:48 +05:30
1. Copy the **Application ID** and **Secret** values.
2023-06-20 00:43:36 +05:30
You need these values to configure Jira.
2021-04-29 21:17:54 +05:30
## Configure Jira for DVCS
2023-06-20 00:43:36 +05:30
To import all GitLab commits and branches into Jira for the groups you specify,
configure Jira for DVCS. This import takes a few minutes and, after
2021-04-29 21:17:54 +05:30
it completes, refreshes every 60 minutes:
2021-12-11 22:18:48 +05:30
1. Complete the [GitLab configuration](#configure-a-gitlab-application-for-dvcs).
2023-06-20 00:43:36 +05:30
1. Go to your DVCS account:
- **For Jira Server**, select **Settings (gear) > Applications > DVCS accounts**.
1. To create a new integration, for **Host**, select **GitLab** or **GitLab Self-Managed**.
1. For **Team or User Account**, enter the relative path of a top-level GitLab group that [the GitLab user](#configure-a-gitlab-application-for-dvcs) can access.
1. In the **Host URL** text box, enter the appropriate URL.
Replace `<gitlab.example.com>` with your GitLab instance domain.
Use `https://<gitlab.example.com>`.
1. For **Client ID**, use the [**Application ID** value](#configure-a-gitlab-application-for-dvcs).
1. For **Client Secret**, use the [**Secret** value](#configure-a-gitlab-application-for-dvcs).
1. Ensure that all other checkboxes are selected.
2021-12-11 22:18:48 +05:30
1. To create the DVCS account, select **Add** and then **Continue**.
1. Jira redirects to GitLab where you have to confirm the authorization.
GitLab then redirects back to Jira where the synced
projects should display in the new account.
2021-04-29 21:17:54 +05:30
2021-12-11 22:18:48 +05:30
To connect additional GitLab projects from other GitLab top-level groups or
2021-04-29 21:17:54 +05:30
personal namespaces, repeat the previous steps with additional Jira DVCS accounts.
2023-06-20 00:43:36 +05:30
For more information about how to use the integration, see [Jira development panel](../development_panel.md).
2021-04-29 21:17:54 +05:30
## Refresh data imported to Jira
Jira imports the commits and branches every 60 minutes for your projects. You
can refresh the data manually from the Jira interface:
1. Sign in to your Jira instance as the user you configured the integration with.
1. Go to **Settings (gear) > Applications**.
1. Select **DVCS accounts**.
1. In the table, for the repository you want to refresh, in the **Last Activity**
2023-03-17 16:20:25 +05:30
column, select the icon.
2023-04-23 21:23:45 +05:30
## Migrate to the GitLab for Jira Cloud app
2023-06-20 00:43:36 +05:30
If you're using the Jira DVCS connector with Jira Cloud, migrate to the GitLab for Jira Cloud app.
For more information, see [Install the GitLab for Jira Cloud app](../connect-app.md#install-the-gitlab-for-jira-cloud-app).
2023-04-23 21:23:45 +05:30
### Feature comparison of DVCS and GitLab for Jira Cloud app
2023-06-20 00:43:36 +05:30
| Feature | DVCS | GitLab for Jira Cloud app |
|--------------------|------------------------|---------------------------|
2023-04-23 21:23:45 +05:30
| Smart Commits | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync MRs | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync branches | **{check-circle}** Yes | **{check-circle}** Yes |
2023-06-20 00:43:36 +05:30
| Sync commits | **{check-circle}** Yes | **{check-circle}** Yes |
2023-04-23 21:23:45 +05:30
| Sync builds | **{dotted-circle}** No | **{check-circle}** Yes |
| Sync deployments | **{dotted-circle}** No | **{check-circle}** Yes |
| Sync feature flags | **{dotted-circle}** No | **{check-circle}** Yes |
2023-06-20 00:43:36 +05:30
| Sync interval | 60 Minutes | Real time |
2023-04-23 21:23:45 +05:30
| Create branches | **{dotted-circle}** No | **{check-circle}** Yes (Only GitLab SaaS) |
| Historic data sync | **{check-circle}** Yes | **{dotted-circle}** No |
### Risks of migrating
The GitLab for Jira Cloud app has a limited ability to sync historic data.
Only branches, commits, builds, deployments, and feature flags created after installing the GitLab for Jira Cloud app are synced with Jira.