Setup
1. Create an OAuth 2.0 app in Atlassian
- Go to developer.atlassian.com
- Create a new app, select OAuth 2.0 (3LO)
- Add the callback URL:
https://your-host/api/auth/jira/callback - Enable scopes:
read:jira-work,write:jira-work,offline_access
2. Configure environment variables
3. Connect via OAuth
Redirect the user to start the OAuth flow:/api/auth/jira/callback exchanges the code for tokens and stores them. Refresh tokens are used automatically when the access token expires.
Webhook Events
Register a Jira webhook to receive real-time events:- URL:
https://your-host/api/webhooks/jira - Events:
jira:issue_created,jira:issue_updated,comment_created
Status Mapping
Jira statuses map to profClawTicketStatus values via the sync adapter:
Mapping is bidirectional. When a profClaw ticket changes status, the corresponding Jira issue updates via the Jira REST API.
Priority Mapping
Bidirectional Sync
The sync engine polls Jira for updates every 60 seconds (configurable viasyncIntervalMs). Conflicts use the latest_wins strategy by default.
Jira Client
TheJiraClient class (src/integrations/jira-client.ts) wraps the Jira REST API v3:
createIssue(fields)- Create a new Jira issueupdateIssue(issueKey, fields)- Update fields on an existing issuetransitionIssue(issueKey, transitionId)- Change issue statusaddComment(issueKey, body)- Add a commentgetIssue(issueKey)- Fetch a single issuesearchIssues(jql, options)- JQL search with pagination