Jira integration
The Jira integration connects one Jira Cloud site to a Gauzy organization. It lets teams map Jira projects to Gauzy projects, keep issues and tasks aligned, receive near-real-time issue changes, and review sync work and conflicts from the Integrations area. See also Collaboration suite, collaboration plugins and realtime workflows, and task automation.
Integration boundary
The integration has a server side connection for each organization and a UI route for managing that connection. The server plugin is loaded only when JIRA_ENABLED is exactly true; when it is off, the UI can still show that Jira is unavailable instead of offering a partial connection flow. The UI route requires the integration view permission and uses the selected organization as its scope. References: packages/…/jira-enabled.ts• L1-25, packages/…/integration-jira-cloud.plugin.ts• L11-26, packages/…/integration-jira-ui.plugin.ts• L21-43
Tenant authorization
Tenant authorization binds an Atlassian grant to the Gauzy tenant, organization, and connecting user. A short-lived, single-use state carries that scope through the public OAuth callback, so the callback does not trust tenant or organization values from the browser or from Jira.
OAuth connection
The connection flow starts in Gauzy and ends at the configured post-install page. The API exchanges the authorization code for a refreshable token, reads the Jira Cloud sites that the token can access, and stores the connection only when the grant can support continued use. A token that reaches more than one site leaves the connection waiting for a site choice.
References: packages/…/jira-cloud.controller.ts• L78-113 packages/…/jira-authorization.controller.ts• L20-35 packages/…/jira-authorization.controller.ts• L42-83
Site selection
The selected Jira site is part of the connection boundary because Jira project and issue identifiers only have meaning within that site. A connection with mappings or synced issue records keeps its site; to work with another site, the user must disconnect and create a new connection.
References: packages/…/jira-authorization.controller.ts• L85-150 packages/…/jira-cloud.controller.ts• L134-181 packages/…/jira-mapping.service.ts• L174-220
Project mappings
A project mapping joins one Jira project to one Gauzy project and defines how data may move. It is the main unit used by imports, webhooks, outbound task updates, status conversion, and issue-type filtering.
Mapping directions
Each mapping uses one of three directions:
inboundbrings Jira issues into Gauzy tasks.outboundsends Gauzy task changes to Jira.bothenables both paths.
The mapping also controls whether sync is enabled, which Jira issue types enter Gauzy, and how Jira status categories or named statuses become Gauzy task statuses. A Gauzy project can send tasks to at most one Jira project.
References: packages/…/jira-ui.service.ts• L80-112 packages/…/jira-mapping.service.ts• L79-126 packages/…/jira-mapping.service.ts• L306-323
Issue synchronization
Issue synchronization uses a shared identity between a Jira issue and a Gauzy task. Inbound work creates or updates the matching task, while outbound work creates or updates the matching Jira issue. This identity prevents later imports, webhooks, or task edits from creating duplicates.
Inbound issue flow
An import or webhook refreshes the Jira issue before applying it. The sync then applies mapped fields and related data to the task, while preserving the mapping's import position for later work.
The main inbound path is:
flowchart LR
A[Jira issue change] --> B[Import or webhook]
B --> C[Read current issue]
C --> D[Find project mapping]
D --> E[Create or update Gauzy task]
E --> F[Add comments, links, and relations]
F --> G[Record cursor and run report]
Inbound sync covers task title, description, status, priority, due date, assignee, labels, comments, attachments as links, parent tasks, and supported issue links. An issue type outside the mapping filter is skipped.
References: packages/…/jira-sync.service.ts• L163-168 packages/…/jira-sync.service.ts• L197-253 packages/…/jira-sync.service.ts• L708-768
Outbound task flow
When a mapped Gauzy task changes, the integration finds its Jira issue through the shared identity. It updates the issue and moves it through the Jira transition that reaches the mapped task status. If no issue exists, it creates one when the task has enough data and the mapping permits outbound sync.
References: packages/…/jira-sync.service.ts• L359-429 packages/…/jira-sync.service.ts• L431-440
Webhook ingestion
Webhooks provide fast inbound updates without making them the only source of truth. Each connection has one dynamic Jira webhook whose filter contains the Jira projects that have enabled inbound mappings. Mapping or site changes bring that webhook into line, and the system refreshes it before expiry.
Delivery acceptance
The webhook endpoint is public because Jira calls it directly. It accepts a delivery only after checking the connection identifier, the signed Jira bearer token, the raw request body, and the webhook identifier. It acknowledges valid work quickly, then reads and applies the current issue in the background.
Jira retries use the same delivery identifier. A shared claim store drops duplicate deliveries, releases a claim when application fails, and allows the retry to try again. If the claim store is unavailable, the integration favors applying an issue twice over losing the issue change; the shared issue identity makes the second apply harmless.
References: packages/…/jira-webhook.controller.ts• L23-34 packages/…/jira-webhook.controller.ts• L48-90 packages/…/jira-webhook-dedupe.service.ts• L13-19
Webhook lifecycle
The webhook follows the set of inbound mappings. It is removed when no mapping needs inbound updates, replaced when its filter or target changes, refreshed before Jira's expiry, and removed during disconnect. If webhook delivery is not available, scheduled imports still provide eventual sync.
References: packages/…/jira-webhook.service.ts• L12-40 packages/…/jira-webhook.service.ts• L81-149
Import maintenance
Imports provide the complete and repeatable path for bringing Jira changes into Gauzy. A manual import can read all issues or only changes since the mapping's last position. A scheduled sweep reads due inbound mappings and also retries connection notices and maintains webhooks before it selects imports.
Resumable imports
An import streams Jira issues in change order and records a run report. It advances the mapping position only after successful work, moves the position back to the first failed issue when needed, and resumes after a safety limit or service error. One live run owns a mapping, so a manual import and a scheduled import do not overlap.
Scheduled sweep
The scheduler places one sweep request on the queue every five minutes. The sweep retries attention notices for refused connections and keeps working webhooks registered or refreshed even when scheduled imports are disabled. When an import interval is active, it removes gone or attention-required connections before taking the batch, then processes the longest-waiting inbound mappings up to the batch limit.
Each mapping runs in its own tenant and organization context. The worker reads the mapping again before claiming it, so a mapping that was removed, disabled, changed to outbound, or claimed by another import is left alone. A failure to start is reported for the next sweep; a failure inside the import belongs to the sync run. A working, unexpired webhook with no recorded error permits a slower reconcile interval, while a missing, expired, or failed webhook keeps the scheduled import as the main feed.
References: packages/…/jira-import-sweep.service.ts• L72-127 packages/…/jira-import-sweep.service.ts• L134-171 packages/…/jira-import-sweep.service.ts• L174-206 packages/…/jira-import-sweep.service.spec.ts• L71-275 packages/…/jira-import.scheduler.ts• L12-29
Conflict handling
Conflict handling protects changes made in both systems since their last agreement. When Jira and Gauzy change the same synced field to different values, Jira's current value is applied to the task and the prior task value is saved as an open conflict.
Conflict resolution
The conflict view shows the task, field, Gauzy value, Jira value, and the run that found the conflict. Users can filter open or resolved conflicts, narrow the list to one sync run, and load older results as needed. A manager can keep Jira's value or restore the Gauzy value. Restoring the Gauzy value uses the normal task update path, so an outbound mapping sends that choice back to Jira. A stale task change blocks the restore rather than overwriting newer work.
The view links each conflict to its task and reports refused resolutions without losing the conflict from the list. After a successful resolution, it refreshes the list so the next older conflict can appear.
References: packages/…/jira-sync-conflict.service.ts• L75-84 packages/…/jira-sync-conflict.service.ts• L232-282 packages/…/jira-conflicts.component.ts• L53-59 packages/…/jira-conflicts.component.ts• L73-112 packages/…/jira-conflicts.component.ts• L152-193 packages/…/jira-conflicts.component.ts• L356-391
Gauzy configuration experience
The Gauzy UI presents Jira as an organization-level integration. The overview page reports whether the server is available, whether the OAuth app is configured, and whether a connection exists. The settings page then groups site choice, webhook state, project mappings, imports, run reports, and conflicts into one connection view.
Connection settings
The settings experience lets an authorized user choose an accessible site, register the webhook again, disconnect, and create or change mappings. When a Jira project is selected, the page reads its statuses and issue types so the user can set status rules and an issue-type filter before saving the mapping. Run results show counts, partial progress, failures, comments, links, and conflicts.
References: packages/…/jira-page.component.ts• L19-25 packages/…/jira-settings.component.ts• L59-64 packages/…/jira-settings.component.ts• L116-169 packages/…/jira-settings.component.ts• L171-244
Server configuration
The server needs an Atlassian OAuth app and a registered callback. Webhooks need an HTTPS delivery address and the app secret used to verify Jira deliveries. The import interval controls scheduled imports; setting it to zero disables scheduled imports but does not disable attention notice retries, webhook maintenance, manual imports, or webhook delivery. A refused token puts the connection into an attention state until a user reconnects it.
References: packages/…/jira-config.ts• L3-39 packages/…/jira-config.ts• L60-105 packages/…/jira-import-sweep.service.ts• L72-80 packages/…/jira-sync.service.ts• L257-263
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the OAuth callback scope and the UI return parameters aligned. A valid grant must return to the correct organization and connection settings.
- Keep mapping direction rules aligned with webhook filters, scheduled import selection, and outbound task ownership.
- Keep the webhook filter and delivery verification contract aligned with the connection's stored site and webhook state.
- Keep import cursor updates and run reports aligned. A partial or failed run must remain safe to resume.
- Keep conflict resolution on the normal task update path so a platform choice can reach Jira when outbound sync is enabled.
- Keep the UI's mapping fields aligned with the server's status map and issue-type validation.
- Keep scheduled-sweep maintenance separate from import-interval behavior. A zero interval must not stop attention notice retries or webhook upkeep.
- Keep due-mapping filtering and batch order aligned. Refused or missing connections must not consume the batch ahead of healthy mappings.
- Keep each sweep import in its tenant context and behind the same claim used by manual imports.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The OAuth grant has no refresh token | The connection is not saved and future scheduled work cannot renew access | Request offline access and require a refreshable grant |
| A reconnect no longer reaches the site's existing issue or project IDs | The connection is rejected instead of risking updates to another Jira site | Pin a site after mappings or synced issue identities exist |
| Jira retries one webhook delivery | The same issue could be applied more than once | Claim the delivery identifier and rely on the shared issue identity |
| A webhook apply fails after acknowledgement | Jira can retry the delivery | Release the delivery claim on failure and leave the import position unchanged |
| An import stops during a page or detail write | Later issues may run, but the failed issue must not be skipped | Resume from the failed or last applied change position |
| A task changes while a conflict is being resolved | A platform value could overwrite newer work | Reject the stale resolution and keep the conflict open |
| A connection's token is refused | Imports and webhook work cannot use Jira until the user acts | Mark the connection for attention and show reconnect in the UI |
| A gone or refused connection remains at the front of the due list | Healthy mappings can be delayed by the sweep batch limit | Filter connection state before cutting the batch |
| The import interval is set to zero and the sweep treats it as a full maintenance stop | Refused-connection notices are not retried and working webhooks can expire | Run notice and webhook maintenance before the interval check |
| A webhook is missing, expired, or marked failed | A slow reconcile interval can leave Jira changes pending too long | Use the normal import interval until the webhook works again |
Key files
| File | Why to read it |
|---|---|
| packages/…/jira-cloud.module.ts | Shows the server module boundary and the services that make up the Jira integration |
| packages/…/jira-cloud.controller.ts | Shows the management contract for connections, sites, mappings, imports, webhooks, runs, and conflicts |
| packages/…/jira-authorization.controller.ts | Explains tenant-scoped OAuth completion and site pinning |
| packages/…/jira-sync.service.ts | Explains inbound imports, webhook applies, outbound task sync, and resumable progress |
| packages/…/jira-webhook.service.ts | Explains webhook filters, refresh, replacement, and removal |
| packages/…/jira-import-sweep.service.ts | Explains scheduled maintenance, connection filtering, batch order, and import claims |
| packages/…/jira-import-sweep.service.spec.ts | Shows the guarantees for interval behavior, tenant isolation, batch fairness, and overlap handling |
| packages/…/jira-sync-conflict.service.ts | Explains baselines, conflict records, and safe resolution |
| packages/…/integration-jira-ui.plugin.ts | Shows the UI route, organization scope, permission, and entry points |
| packages/…/jira-page.component.ts | Shows the connect and connection overview experience |
| packages/…/jira-settings.component.ts | Shows the site, webhook, mapping, import, run, and conflict settings experience |
| packages/…/jira-conflicts.component.ts | Shows conflict filters, run scoping, paging, task links, and resolution feedback |