|
| 1 | +# Enterprise Integrations Setup Guide |
| 2 | + |
| 3 | +This guide helps you configure devlog to sync with enterprise project management tools like Jira, Azure DevOps, and GitHub. |
| 4 | + |
| 5 | +## Configuration File Setup |
| 6 | + |
| 7 | +Create a configuration file named `devlog-integrations.config.json` in one of these locations: |
| 8 | +- Your project root directory |
| 9 | +- `~/.devlog-integrations.config.json` (global config) |
| 10 | +- `.devlog/integrations.config.json` (workspace-specific) |
| 11 | + |
| 12 | +Copy the template from `devlog-integrations.config.template.json` and fill in your credentials. |
| 13 | + |
| 14 | +## Platform-Specific Setup |
| 15 | + |
| 16 | +### Jira Integration |
| 17 | + |
| 18 | +1. **Get your Jira API Token:** |
| 19 | + - Go to https://id.atlassian.com/manage-profile/security/api-tokens |
| 20 | + - Click "Create API token" |
| 21 | + - Copy the generated token |
| 22 | + |
| 23 | +2. **Configuration:** |
| 24 | + ```json |
| 25 | + { |
| 26 | + "integrations": { |
| 27 | + "jira": { |
| 28 | + "baseUrl": "https://your-company.atlassian.net", |
| 29 | + "projectKey": "PROJ", |
| 30 | + "apiToken": "your-jira-api-token", |
| 31 | + |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | + ``` |
| 36 | + |
| 37 | +3. **Required Permissions:** |
| 38 | + - Browse projects |
| 39 | + - Create issues |
| 40 | + - Edit issues |
| 41 | + - View development tools (optional, for linking commits) |
| 42 | + |
| 43 | +### Azure DevOps Integration |
| 44 | + |
| 45 | +1. **Get your Personal Access Token (PAT):** |
| 46 | + - Go to https://dev.azure.com/{organization}/_usersSettings/tokens |
| 47 | + - Click "New Token" |
| 48 | + - Select scopes: Work Items (Read & write) |
| 49 | + - Copy the generated token |
| 50 | + |
| 51 | +2. **Configuration:** |
| 52 | + ```json |
| 53 | + { |
| 54 | + "integrations": { |
| 55 | + "ado": { |
| 56 | + "organization": "your-organization", |
| 57 | + "project": "your-project", |
| 58 | + "personalAccessToken": "your-ado-pat" |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + ``` |
| 63 | + |
| 64 | +3. **Required Permissions:** |
| 65 | + - Work Items: Read & Write |
| 66 | + - Project and Team: Read (for project access) |
| 67 | + |
| 68 | +### GitHub Integration |
| 69 | + |
| 70 | +1. **Get your GitHub Token:** |
| 71 | + - Go to https://github.com/settings/tokens |
| 72 | + - Click "Generate new token (classic)" |
| 73 | + - Select scopes: `repo` (for private repos) or `public_repo` (for public repos) |
| 74 | + - Copy the generated token |
| 75 | + |
| 76 | +2. **Configuration:** |
| 77 | + ```json |
| 78 | + { |
| 79 | + "integrations": { |
| 80 | + "github": { |
| 81 | + "owner": "your-github-username", |
| 82 | + "repo": "your-repository", |
| 83 | + "token": "your-github-token" |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + ``` |
| 88 | + |
| 89 | +3. **Required Permissions:** |
| 90 | + - Issues: Read & Write |
| 91 | + - Repository contents: Read (for context) |
| 92 | + |
| 93 | +## Usage Examples |
| 94 | + |
| 95 | +### Creating and Syncing a Devlog |
| 96 | + |
| 97 | +```typescript |
| 98 | +// Create a devlog entry |
| 99 | +const entry = await devlog.createDevlog({ |
| 100 | + title: "Implement user authentication", |
| 101 | + type: "feature", |
| 102 | + description: "Add JWT-based authentication system", |
| 103 | + priority: "high", |
| 104 | + businessContext: "Users need secure login to access protected features", |
| 105 | + technicalContext: "Using JWT tokens with refresh mechanism" |
| 106 | +}); |
| 107 | + |
| 108 | +// Sync with all configured platforms |
| 109 | +await devlog.syncAllIntegrations(entry.id); |
| 110 | + |
| 111 | +// Or sync with specific platforms |
| 112 | +await devlog.syncWithJira(entry.id); |
| 113 | +await devlog.syncWithGitHub(entry.id); |
| 114 | +await devlog.syncWithADO(entry.id); |
| 115 | +``` |
| 116 | + |
| 117 | +### MCP Tools |
| 118 | + |
| 119 | +The following MCP tools are available for integrations: |
| 120 | + |
| 121 | +- `sync_with_jira` - Sync devlog entry with Jira |
| 122 | +- `sync_with_ado` - Sync devlog entry with Azure DevOps |
| 123 | +- `sync_with_github` - Sync devlog entry with GitHub |
| 124 | +- `sync_all_integrations` - Sync with all configured platforms |
| 125 | + |
| 126 | +## Field Mappings |
| 127 | + |
| 128 | +### Devlog Type to External Systems |
| 129 | + |
| 130 | +| Devlog Type | Jira Issue Type | ADO Work Item Type | GitHub Labels | |
| 131 | +|-------------|----------------|-------------------|---------------| |
| 132 | +| feature | Story | User Story | feature | |
| 133 | +| bugfix | Bug | Bug | bugfix | |
| 134 | +| task | Task | Task | task | |
| 135 | +| refactor | Task | Task | refactor | |
| 136 | +| docs | Task | Task | docs | |
| 137 | + |
| 138 | +### Priority Mappings |
| 139 | + |
| 140 | +| Devlog Priority | Jira Priority | ADO Priority | GitHub Labels | |
| 141 | +|-----------------|---------------|--------------|---------------| |
| 142 | +| low | Low | 4 | - | |
| 143 | +| medium | Medium | 3 | - | |
| 144 | +| high | High | 2 | priority-high | |
| 145 | +| critical | Highest | 1 | priority-high | |
| 146 | + |
| 147 | +## Security Considerations |
| 148 | + |
| 149 | +1. **Never commit credentials to version control** |
| 150 | +2. **Use environment variables for sensitive data** |
| 151 | +3. **Regularly rotate API tokens and PATs** |
| 152 | +4. **Use the principle of least privilege for permissions** |
| 153 | +5. **Consider using organizational secrets management** |
| 154 | + |
| 155 | +## Troubleshooting |
| 156 | + |
| 157 | +### Common Issues |
| 158 | + |
| 159 | +1. **Authentication Errors:** |
| 160 | + - Verify API tokens/PATs are correct and not expired |
| 161 | + - Check that email matches Jira account (for Jira) |
| 162 | + - Ensure permissions are correctly set |
| 163 | + |
| 164 | +2. **Network Issues:** |
| 165 | + - Verify URLs are accessible from your network |
| 166 | + - Check for corporate firewall restrictions |
| 167 | + - Confirm SSL/TLS certificates are valid |
| 168 | + |
| 169 | +3. **Permission Errors:** |
| 170 | + - Verify account has required permissions on the target system |
| 171 | + - Check project access permissions |
| 172 | + - Ensure work item types exist (for ADO) |
| 173 | + |
| 174 | +### Debug Mode |
| 175 | + |
| 176 | +Set environment variable `DEBUG=devlog:*` to enable debug logging: |
| 177 | + |
| 178 | +```bash |
| 179 | +DEBUG=devlog:* pnpm start |
| 180 | +``` |
| 181 | + |
| 182 | +## Advanced Configuration |
| 183 | + |
| 184 | +### Custom Field Mappings |
| 185 | + |
| 186 | +You can extend the field mappings by modifying the mapping functions in `devlog-manager.ts`: |
| 187 | + |
| 188 | +- `mapDevlogTypeToJiraIssueType()` |
| 189 | +- `mapDevlogTypeToADOWorkItemType()` |
| 190 | +- `mapDevlogPriorityToJiraPriority()` |
| 191 | +- `mapDevlogPriorityToADOPriority()` |
| 192 | + |
| 193 | +### Webhook Integration (Future) |
| 194 | + |
| 195 | +Future versions will support webhooks for real-time synchronization: |
| 196 | + |
| 197 | +- Jira → Devlog updates |
| 198 | +- ADO → Devlog updates |
| 199 | +- GitHub → Devlog updates |
| 200 | + |
| 201 | +## Environment Variables |
| 202 | + |
| 203 | +Alternative to config file, you can use environment variables: |
| 204 | + |
| 205 | +```bash |
| 206 | +# Jira |
| 207 | +DEVLOG_JIRA_BASE_URL=https://your-company.atlassian.net |
| 208 | +DEVLOG_JIRA_PROJECT_KEY=PROJ |
| 209 | +DEVLOG_JIRA_API_TOKEN=your-token |
| 210 | + |
| 211 | + |
| 212 | +# Azure DevOps |
| 213 | +DEVLOG_ADO_ORGANIZATION=your-org |
| 214 | +DEVLOG_ADO_PROJECT=your-project |
| 215 | +DEVLOG_ADO_PAT=your-pat |
| 216 | + |
| 217 | +# GitHub |
| 218 | +DEVLOG_GITHUB_OWNER=your-username |
| 219 | +DEVLOG_GITHUB_REPO=your-repo |
| 220 | +DEVLOG_GITHUB_TOKEN=your-token |
| 221 | +``` |
0 commit comments