GitLab for Jira Cloud app development contribute
Developers have several options for how set up a development environment for the GitLab for Jira Cloud app:
- A full environment with Jira. Use this when you need to test interactions with Jira.
- A full environment with a Jira Connect proxy. Use this when you need to test multiple GitLab instances connecting to Jira through a Jira Connect proxy, or when testing changes to the Jira Connect proxy itself.
- A local environment without Jira. You can use this quicker setup if you do not require Jira, for example when testing the GitLab frontend.
Set up with Jira
The following are required to install the app:
A Jira Cloud instance. Atlassian provides free instances for development and testing.
A GitLab instance available over the internet. For the app to work, Jira Cloud should be able to connect to the GitLab instance through the internet. For this we recommend using Gitpod or a similar cloud development environment. For more information on using Gitpod with GDK, see the:
- GDK with Gitpod documentation.
- GDK in Gitpod video.
GitLab team members must not use tunneling tools such as Serveo or
ngrok
. These are security risks, and must not be run on GitLab developer laptops.Jira requires all connections to the app host to be over SSL. If you set up your own environment, remember to enable SSL and an appropriate certificate.
Setting up GitPod
If you are using Gitpod
you must make port 3000
public.
Install the app in Jira
To install the app in Jira:
Enable Jira development mode to install apps that are not from the Atlassian Marketplace:
- In Jira, go to Jira settings > Apps > Manage apps.
- Scroll to the bottom of the Manage apps page and select Settings.
- Select Enable development mode and select Apply.
Install the app:
In Jira, go to Jira settings > Apps > Manage apps.
Select Upload app.
In the From this URL field, provide a link to the app descriptor. The host and port must point to your GitLab instance.
For example:
https://xxxx.gitpod.io/-/jira_connect/app_descriptor.json
Select Upload.
If the install was successful, you should see the GitLab for Jira Cloud app under Manage apps. You can also select Getting Started to open the configuration page rendered from your GitLab instance.
Note that any changes to the app descriptor requires you to uninstall then reinstall the app.
If the Installed and ready to go! dialog opens asking you to Get started, do not get started yet and instead select Close.
You must now set up the OAuth authentication flow.
Set up the GitLab OAuth authentication flow
GitLab for Jira users authenticate with GitLab using GitLab OAuth.
Ensure you have installed the app in Jira first before doing these steps, otherwise the app installation in Jira fails.
The following steps describe setting up an environment to test the GitLab OAuth flow:
- Start a Gitpod session.
- On your GitLab instance, go to Admin > Applications.
- Create a new application with the following settings:
- Name:
GitLab for Jira
- Redirect URI:
YOUR_GITPOD_INSTANCE/-/jira_connect/oauth_callbacks
- Trusted: No
- Confidential: No
- Scopes:
api
- Name:
- Copy the Application ID value.
- Go to Admin > Settings > General.
- Expand GitLab for Jira App.
- Paste the Application ID value into Jira Connect Application ID.
- In Jira Connect Proxy URL, enter
YOUR_GITPOD_INSTANCE
(for example,https://xxxx.gitpod.io
). - Enable public key storage: Leave unchecked.
- Select Save changes.
Set up the app in Jira
Ensure you have set up OAuth first first before doing these steps, otherwise these steps fail.
- In Jira, go to Jira settings > Apps > Manage apps.
- Scroll to User-installed apps, find your GitLab for Jira Cloud app and expand it.
- Select Get started.
You should be able to authenticate with your GitLab instance and begin linking groups.
Troubleshooting
App installation fails
If the app installation fails, you might need to delete jira_connect_installations
from your database.
- Open the database console.
- Run
TRUNCATE TABLE jira_connect_installations CASCADE;
.
Not authorized to access the file
If you use Gitpod and you get an error about Jira not being able to access the descriptor file, you will need to make GitPod port public.
Setting up a Jira Connect Proxy
When a self-managed instance installs the GitLab for Jira app from the Atlassian Marketplace, the self-managed instance must use GitLab.com as a Jira Connect proxy. You can emulate this setup if you need to develop or test features such as the handling of Jira lifecycle events and branch creation.
To set up a development Jira Connect Proxy:
- A Jira Cloud instance. Atlassian provides free instances for development and testing.
- Two GitLab instances available over the internet.
One to serve as the Jira Connect proxy (simulating GitLab.com)
One to serve as the GitLab instance that will connect to Jira through the Jira Connect proxy
For the app to work, Jira Cloud should be able to connect to the Jira Connect proxy instance through the internet. For this we recommend using Gitpod or a similar cloud development environment. For more information on using Gitpod with GDK, see the:
- GDK with Gitpod documentation.
- GDK in Gitpod video.
GitLab team members must not use tunneling tools such as Serveo or
ngrok
. These are security risks, and must not be run on GitLab developer laptops.Jira requires all connections to the app host to be over SSL. If you set up your own environment, remember to enable SSL and an appropriate certificate.
Setting up GitPod
If you are using Gitpod
you must make port 3000
public.
Set up the Jira Connect proxy instance
For the Jira Connect proxy instance, follow the GDK with Gitpod instructions to start a new Gitpod workspace.
Set up OAuth authentication on the Jira Connect proxy by following the Set up the GitLab OAuth authentication flow section.
Configure the Jira Connect proxy to serve as a proxy.
Install the GitLab for Jira Cloud app in Jira
Follow the Install the app in Jira section, but use the URL of your Jira Connect proxy instance for the app descriptor:
https://JIRA_CONNECT_PROXY_INSTANCE/-/jira_connect/app_descriptor.json
If the Installed and ready to go! dialog opens, select Close (don’t select Get started yet).
Set up the secondary GitLab instance
Set up a second GitLab instance using Gitpod, following the same GDK with Gitpod instructions as for the proxy instance
Set up OAuth authentication on this instance following the same steps as in Set up the GitLab OAuth authentication flow, but with a crucial difference:
When setting the Redirect URI, use the URL of your Jira Connect proxy instance, not this secondary instance:
https://JIRA_CONNECT_PROXY_INSTANCE/-/jira_connect/oauth_callbacks
Configure this GitLab instance to use the proxy:
- Go to Admin > Settings > General
- Expand GitLab for Jira App
- Paste the Application ID value into Jira Connect Application ID
- In Jira Connect Proxy URL, enter
JIRA_CONNECT_PROXY_INSTANCE
(for example,https://xxxx.gitpod.io
) - Select Save changes
Complete the setup in Jira
- In Jira, go to Jira settings > Apps > Manage apps.
- Scroll to User-installed apps, find your GitLab for Jira Cloud app and expand it.
- Select Get started.
- To link the app to the secondary GitLab instance, select Change GitLab version.
- Select all checkboxes, then select Next.
- In GitLab instance URL ,enter
GITLAB_INSTANCE
(for example,https://xxxx.gitpod.io
), then select Save. - Select Sign in to GitLab.
- Select Authorize. A list of groups is now visible.
- Select Link groups.
- To link to a group, select Link.
Setup without Jira
If you do not require Jira to test with, you can use the Jira connect test tool and your local GDK.
Clone the Jira-connect-test-tool
git clone git@gitlab.com:gitlab-org/manage/integrations/jira-connect-test-tool.git
.Start the app
bundle exec rackup
. (The app requires your GDK GitLab to be available onhttp://127.0.0.1:3000
.).Open
config/gitlab.yml
and uncomment thejira_connect
config.If running GDK on a domain other than
localhost
, you must add the domain toadditional_iframe_ancestors
. For example:additional_iframe_ancestors: ['localhost:*', '127.0.0.1:*', 'gdk.test:*']
Restart GDK.
Go to
http://127.0.0.1:3000/-/user_settings/personal_access_tokens
.Create a new token with the
api
scope and copy the token.Go to
http://localhost:9292
.Paste the token and select Install GitLab.com Jira Cloud app.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support