jira-automation-webhooks-skooh
Trigger internal workflows from Jira automation rules using Skooh.
Use Case
Jira Automation can trigger webhooks on issue events. Use Skooh to forward these to internal workflow handlers:
- Auto-provision resources when specific issues are created
- Sync issue status with internal systems
- Trigger deployments from issue transitions
- Send notifications to internal chat
Setup
1. Create Skooh Endpoint
Create "Jira Automation" in Skooh.
2. Run the Skooh Proxy
Using the Desktop App:
- Download the Skooh Desktop App
- Enter your API key and hook token
- Set forwarding URL (e.g., `http://localhost:3000/jira\`)
- Click Connect
Using Docker:
docker run -d \\
--name skooh-jira \\
-e SKOOH_TOKEN=jira-automation \\
-e SKOOH_API_KEY=your_api_key \\
-e FORWARD_URL=http://workflow-handler:3000/jira \\
--restart unless-stopped \\
skooh/proxy
3. Create Jira Automation Rule
Note: See Jira Automation documentation for current instructions.
In Jira:
- Go to Project Settings → Automation
- Create new rule
- Choose trigger (e.g., "Issue created", "Issue transitioned")
- Add action: Send web request
- URL: Your Skooh URL
- Method: POST
- Body: Custom JSON (see below)
Customizing the Payload
Use Jira smart values to build useful payloads:
{
"event": "issue_created",
"issue": {
"key": "{{issue.key}}",
"summary": "{{issue.summary}}",
"type": "{{issue.issueType.name}}",
"priority": "{{issue.priority.name}}",
"status": "{{issue.status.name}}",
"reporter": "{{issue.reporter.displayName}}",
"assignee": "{{issue.assignee.displayName}}",
"created": "{{issue.created}}",
"labels": {{issue.labels.asJsonStringArray}},
"components": {{issue.components.name.asJsonStringArray}}
},
"project": {
"key": "{{issue.project.key}}",
"name": "{{issue.project.name}}"
}
}
Handling Jira Events
app.post('/jira', express.json(), async (req, res) => {
const { event, issue, project } = req.body;
switch (event) {
case 'issue_created':
await handleIssueCreated(issue, project);
break;
case 'issue_transitioned':
await handleIssueTransitioned(issue, req.body.transition);
break;
case 'issue_assigned':
await handleIssueAssigned(issue);
break;
}
res.status(200).send('OK');
});
async function handleIssueCreated(issue, project) {
// Auto-provision based on issue type
if (issue.type === 'Infrastructure Request') {
await provisioningService.createRequest({
jiraKey: issue.key,
summary: issue.summary,
requester: issue.reporter
});
}
// Notify internal chat
await chatService.postMessage(\`New issue: \${issue.key} - \${issue.summary}\`);
}
Transition-Based Workflows
Trigger actions on status changes:
async function handleIssueTransitioned(issue, transition) {
// Deploy on "Ready for Release"
if (transition.to === 'Ready for Release') {
await deploymentService.queueRelease({
jiraKey: issue.key,
components: issue.components
});
}
// Close related tickets on "Done"
if (transition.to === 'Done') {
await closeRelatedIssues(issue.key);
}
}
Authentication
Add a secret header in Jira Automation:
app.post('/jira', express.json(), (req, res) => {
const secret = req.headers['x-jira-secret'];
if (secret !== process.env.JIRA_WEBHOOK_SECRET) {
return res.status(401).send('Unauthorized');
}
// Process...
});
In Jira Automation, add custom header:
- Header name: `x-jira-secret`
- Header value: Your secret
Testing with Replay
- Trigger your automation rule in Jira
- Find the webhook in Skooh
- Replay to test your handler
- No need to create/transition issues repeatedly
Written by Skooh Team