This directory contains the GitHub Actions workflow and scripts to automatically sync GitHub issues to Jira when the "tracked" label is added.
When a user adds the tracked label to a GitHub issue, the workflow automatically:
- Creates a corresponding Jira ticket in the specified project
- Formats the ticket similar to Tasktop (with GitHub issue content and metadata)
- Optionally links the ticket to an Epic
- Adds a comment back to the GitHub issue with the Jira ticket link
In your GitHub repository settings (Settings → Secrets and variables → Actions), add the following secrets:
JIRA_URL: Your Jira instance URL (e.g.,https://jira.ngage.netapp.com)JIRA_PAT: Jira Personal Access Token (create at: Profile → Personal Access Tokens in Jira)JIRA_PROJECT_KEY: Jira project key (e.g.,TRID)
JIRA_EPIC_KEY: Epic key to automatically link new tickets to (e.g.,TRID-10984)
Note: GITHUB_TOKEN is automatically provided by GitHub Actions.
The Epic Link field ID varies by Jira instance. To find yours:
- Go to your Jira instance
- Open any issue in your project
- Open browser DevTools (F12) → Network tab
- Click "Edit" on the issue
- Look for API calls to find the Epic Link field name (usually
customfield_10008or similar) - Update line 103 in
.github/scripts/create_jira_ticket.pywith your field name
Alternatively, use the Jira API:
curl -u email@example.com:YOUR_API_TOKEN \
https://jira.ngage.netapp.com/rest/api/2/field | grep -i epic-
Push these files to your repository:
git add .github/ git commit -m "Add GitHub to Jira sync automation" git push -
Create a test issue or use an existing one
-
Add the
trackedlabel -
Check the "Actions" tab in GitHub to see the workflow run
-
Verify the Jira ticket was created
workflows/sync-issue-to-jira.yml: GitHub Actions workflow definitionscripts/create_jira_ticket.py: Python script that creates the Jira ticket
- Triggers only when the
trackedlabel is added - Fetches full issue content from GitHub API
- Summary: Formatted as
trident#{issue_number}: {issue_title} - Description: Full issue body + GitHub metadata (similar to Tasktop format)
- Type: Automatically sets to "Bug" if issue has
buglabel, otherwise "Task" - Labels: Copies GitHub labels + adds
github-issuelabel - Epic Link: Optional automatic linking to specified Epic
- Posts a comment on the GitHub issue with the Jira ticket link
- Example: "📋 Jira ticket created: TRID-18758"
Edit .github/workflows/sync-issue-to-jira.yml line 10:
if: github.event.label.name == 'your-custom-label'Edit .github/scripts/create_jira_ticket.py around line 74 to change how issue types are determined:
# Current logic:
issue_type = 'Bug' if 'bug' in issue_labels else 'Task'
# Example alternatives:
issue_type = 'Story' if 'enhancement' in issue_labels else 'Bug' if 'bug' in issue_labels else 'Task'Modify the jira_payload in the Python script to include additional Jira fields like priority, components, etc.
- Verify the workflow file is in the default branch (usually
mainormaster) - Check that Actions are enabled in repository settings
- Ensure you're adding the exact label name specified in the workflow
- Verify your Jira API token is valid
- Ensure your Jira email is correct
- Test authentication manually:
curl -u email@example.com:YOUR_API_TOKEN \ https://jira.ngage.netapp.com/rest/api/2/myself
- Verify the Epic key exists and is accessible
- Check the custom field ID for Epic Link (see step 2 above)
- Some Jira instances require special permissions to link to Epics
- Check the Actions tab in GitHub for detailed logs
- Look for error messages in the Python script output
- Verify all required secrets are configured
| Feature | Tasktop | This Solution |
|---|---|---|
| Trigger | Label addition | Label addition ✅ |
| Ticket Creation | Automatic | Automatic ✅ |
| Epic Linking | Yes | Yes ✅ |
| Bi-directional Sync | Yes | No (one-way only) |
| Comment Sync | Yes | Can be added |
| Status Sync | Yes | Can be added |
| Cost | Licensed | Free ✅ |
| Customization | Limited | Full control ✅ |
Potential improvements you could add:
- Bidirectional Sync: Sync Jira updates back to GitHub
- Comment Sync: Mirror comments between platforms
- Status Sync: Update GitHub issue status based on Jira status
- Assignee Sync: Map and sync assignees
- Update Handling: Detect when tracked issues are updated
- Bulk Operations: Handle multiple label additions efficiently
- Notification: Send Slack/email notifications on sync
For issues or questions:
- Check the Actions logs in GitHub
- Review the Jira API documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v2/
- Verify your configuration follows the setup instructions above