Skip to content

GitLab Integration

TwoWeeks can pull issues from GitLab (SaaS or self-hosted) and push final estimates back as labels.


TypeURL formatAuth
GitLab SaaShttps://gitlab.comPersonal Access Token
Self-hostedhttps://gitlab.your-company.comPersonal Access Token
  1. In GitLab, go to Settings → Access Tokens (or Preferences → Access Tokens)
  2. Create a Personal Access Token with the api scope (or read_api for read-only import)
  3. Copy the token — it is shown only once
  1. As a session host, click Import from GitLab in the sidebar
  2. Fill in the connection form:
FieldDescription
GitLab URLFull URL to your GitLab instance (e.g. https://gitlab.com)
Personal Access TokenYour PAT with api scope
Allow insecureEnable for self-signed certificates on private instances. Your administrator can disable this (INTEGRATION_ALLOW_INSECURE_TLS=false); you’ll then see a warning and the certificate is always checked

If your organisation uses a custom CA certificate, the server administrator can configure it via CA_BUNDLE_PATH or the --ca-bundle CLI flag.

  1. Click Test connection & continue

Your GitLab PAT is encrypted at rest in the database when the server is configured with an ENCRYPTION_KEY environment variable. Without it, the token is stored in plaintext (a warning is logged at startup). The token is never sent to connected developers — all GitLab API calls go through the backend.

TwoWeeks reads and writes estimates using GitLab labels. The default label prefix is Estimate. For example, a story-point estimate of 5 appears as a label Estimate::5.

You can change the label prefix per session (e.g. SP, StoryPoints) — this is configured during the connect step or from session settings.

When importing issues, TwoWeeks reads the current estimate label (if any) and shows it in the import list. When pushing an estimate back:

  1. Any existing label with the configured prefix is removed
  2. The new estimate label ({prefix}::{value}) is added
  3. A comment is posted: TwoWeeks estimate: **5**

Other labels on the issue are left untouched.

After connecting, use the filter panel:

FilterDescription
ProjectSelect a GitLab project
StateOpened, closed, or all
MilestoneFilter by milestone
LabelsFilter by existing labels
Text searchFree-text search across title and description
  1. Set up filters and click Search issues
  2. Review the results — you will see title, state, existing estimate, and labels for each issue
  3. Select issues to import (or use Select all)
  4. Click Review import
  5. Confirm and click Import N tickets

Imported tickets appear in your session ticket queue. Each ticket stores its GitLab project ID and issue IID for later updates.

When you finalize an estimate for a GitLab-imported ticket, TwoWeeks pushes the estimate automatically:

  • The old estimate label is removed
  • The new estimate label is added
  • A comment records the estimate

You can also push manually by clicking the Update in GitLab button on the finalized ticket card.

If a GitLab issue changes after import, the host can pull the latest version:

  1. Open the ticket’s details panel (double-click the ticket)
  2. Click Resync next to the GitLab issue reference
  3. The title, description, labels, and current estimate update from GitLab

From the Account page, you can save GitLab connection defaults that pre-fill when you create any new session:

  • GitLab URL and PAT
  • Default project ID
  • Default label prefix
  • Default label, state, search, and milestone filters

These are stored securely (the PAT is encrypted) and can be overridden per session. The saved PAT is never sent back to your browser: the form shows Token saved · Replace, and the importer leaves the token field empty (“Saved token will be used”) — the server uses the saved PAT for the same GitLab URL. Changing the saved URL without entering a new PAT clears the old one.

ErrorFix
Could not reach GitLabCheck the URL and network. Error messages are deliberately generic — your administrator can see the detailed reason in the server log
URL is not allowedThe server’s integration policy blocks that address (for example cloud-metadata addresses, or localhost unless your administrator allow-lists it with INTEGRATION_HOST_ALLOWLIST)
GitLab rejected the credentialsVerify the PAT is correct and has api scope. Check that the token has not expired
Could not verify GitLab’s TLS certificateEnable “Allow insecure” for self-signed certificates (if your administrator allows it), or ask your admin to configure CA_BUNDLE_PATH
Search returns no resultsCheck project selection and filters. Try broadening the search
Update failsVerify the issue still exists in GitLab. Check that the PAT has write access
Resync failsThe issue may have been deleted or the connection may have expired — reconnect to GitLab and try again