Skip to content

Webhook Integration Examples

Learn how to integrate Gira with popular services using practical, copy-paste webhook configurations.

📖 Table of Contents

💬 Team Communication

Slack Integration

Basic Setup

# Simple notification for all ticket events
gira webhook add slack https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX \
  --template slack

Advanced Slack Configuration

# High-priority alerts to #urgent channel
gira webhook add slack-urgent https://hooks.slack.com/services/T00000000/B00000000/URGENT_WEBHOOK_URL \
  --template slack \
  --filter "priority:critical OR priority:high" \
  --events ticket_created,ticket_updated

# Bug notifications to #dev-team channel
gira webhook add slack-bugs https://hooks.slack.com/services/T00000000/B00000000/BUGS_WEBHOOK_URL \
  --template slack \
  --filter "type:bug" \
  --events ticket_created,ticket_moved

# Sprint completion reports to #project-updates
gira webhook add slack-sprints https://hooks.slack.com/services/T00000000/B00000000/SPRINTS_WEBHOOK_URL \
  --template slack \
  --events sprint_completed

Custom Slack Payload

{
  "name": "slack-custom",
  "url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
  "template": "custom",
  "events": ["ticket_created"],
  "payload_template": {
    "text": "🎫 New Ticket: {{ticket.id}} - {{ticket.title}}",
    "blocks": [
      {
        "type": "section",
        "text": {
          "type": "mrkdwn",
          "text": "*{{ticket.title}}*\n{{ticket.description}}"
        }
      },
      {
        "type": "section",
        "fields": [
          {
            "type": "mrkdwn",
            "text": "*Priority:*\n{{ticket.priority}}"
          },
          {
            "type": "mrkdwn", 
            "text": "*Assignee:*\n{{ticket.assignee}}"
          }
        ]
      }
    ]
  }
}

Discord Integration

Basic Discord Setup

# General notifications to Discord channel
gira webhook add discord https://discord.com/api/webhooks/123456789/WEBHOOK_TOKEN \
  --template discord

Discord with Custom Embeds

# Critical issues with red embeds
gira webhook add discord-critical https://discord.com/api/webhooks/123456789/CRITICAL_TOKEN \
  --template discord \
  --filter "priority:critical" \
  --events ticket_created,ticket_updated

# Completed tickets with green embeds
gira webhook add discord-done https://discord.com/api/webhooks/123456789/DONE_TOKEN \
  --template discord \
  --filter "status:done" \
  --events ticket_moved

Microsoft Teams

# Team notifications
gira webhook add teams https://outlook.office.com/webhook/a1b2c3d4.../IncomingWebhook/... \
  --template teams \
  --events ticket_created,ticket_updated,ticket_moved

🎯 Project Management

Jira Integration

Bidirectional Sync

# Sync all ticket events to Jira
gira webhook add jira-sync https://company.atlassian.net/rest/webhooks/1.0/webhook/gira \
  --template jira \
  --auth bearer --token "${JIRA_API_TOKEN}" \
  --events ticket_created,ticket_updated,ticket_moved

Selective Jira Sync

# Only sync high-priority items
gira webhook add jira-priority https://company.atlassian.net/rest/webhooks/1.0/webhook/gira \
  --template jira \
  --auth bearer --token "${JIRA_API_TOKEN}" \
  --filter "priority:high OR priority:critical"

# Only sync specific project types
gira webhook add jira-features https://company.atlassian.net/rest/webhooks/1.0/webhook/gira \
  --template jira \
  --auth bearer --token "${JIRA_API_TOKEN}" \
  --filter "type:feature OR type:epic"

Linear Integration

# Sync to Linear workspace
gira webhook add linear https://api.linear.app/webhooks/gira \
  --auth bearer --token "${LINEAR_API_KEY}" \
  --events ticket_created,ticket_updated \
  --headers '{"Content-Type": "application/json", "Linear-Source": "gira"}'

Asana Integration

# Create Asana tasks for tickets
gira webhook add asana https://app.asana.com/api/1.0/webhooks \
  --auth bearer --token "${ASANA_ACCESS_TOKEN}" \
  --filter "type:feature OR type:bug"

🚀 CI/CD Integration

GitHub Actions

Trigger Workflows

# Trigger GitHub Actions workflow on ticket events
gira webhook add github-actions https://api.github.com/repos/owner/repo/dispatches \
  --template github-actions \
  --auth bearer --token "${GITHUB_TOKEN}" \
  --events ticket_created,ticket_moved \
  --filter "labels~automation"

Custom GitHub Webhook

{
  "name": "github-custom",
  "url": "https://api.github.com/repos/myorg/myrepo/dispatches",
  "auth": {
    "type": "bearer",
    "token": "${GITHUB_TOKEN}"
  },
  "events": ["ticket_created"],
  "filter": "type:feature",
  "payload_template": {
    "event_type": "gira_ticket_created",
    "client_payload": {
      "ticket_id": "{{ticket.id}}",
      "ticket_title": "{{ticket.title}}",
      "priority": "{{ticket.priority}}",
      "assignee": "{{ticket.assignee}}"
    }
  }
}

GitLab CI

# Trigger GitLab pipeline
gira webhook add gitlab https://gitlab.com/api/v4/projects/PROJECT_ID/trigger/pipeline \
  --auth api_key --api-key "token" --api-value "${GITLAB_TRIGGER_TOKEN}" \
  --events ticket_created \
  --filter "labels~deploy"

Jenkins

# Trigger Jenkins build
gira webhook add jenkins https://jenkins.company.com/job/gira-integration/build \
  --auth basic --username "${JENKINS_USER}" --password "${JENKINS_API_TOKEN}" \
  --events ticket_moved \
  --filter "status:done AND type:feature"

AWS CodeBuild

# Trigger AWS CodeBuild project
gira webhook add codebuild https://codebuild.us-east-1.amazonaws.com/webhooks/gira \
  --auth bearer --token "${AWS_WEBHOOK_TOKEN}" \
  --events ticket_created \
  --filter "labels~deploy"

📊 Monitoring & Analytics

Datadog

# Send metrics to Datadog
gira webhook add datadog https://api.datadoghq.com/api/v1/events \
  --auth api_key --api-key "DD-API-KEY" --api-value "${DATADOG_API_KEY}" \
  --events ticket_created,ticket_moved,sprint_completed

New Relic

# Custom events to New Relic
gira webhook add newrelic https://insights-collector.newrelic.com/v1/accounts/ACCOUNT_ID/events \
  --auth api_key --api-key "X-Insert-Key" --api-value "${NEWRELIC_INSERT_KEY}" \
  --events ticket_created,ticket_updated,ticket_moved

Grafana

# Send annotations to Grafana
gira webhook add grafana https://grafana.company.com/api/annotations \
  --auth bearer --token "${GRAFANA_API_TOKEN}" \
  --events sprint_completed,ticket_moved \
  --filter "status:done"

Custom Analytics

# Send to custom analytics service
gira webhook add analytics https://analytics.company.com/api/events \
  --auth bearer --token "${ANALYTICS_TOKEN}" \
  --events ticket_created,ticket_updated,ticket_moved,sprint_completed

🤖 Automation Platforms

Zapier

# Connect to Zapier webhook
gira webhook add zapier https://hooks.zapier.com/hooks/catch/12345/abcdef/ \
  --events ticket_created,ticket_updated \
  --filter "priority:high OR priority:critical"

Make.com (formerly Integromat)

# Send to Make.com scenario
gira webhook add make https://hook.eu1.make.com/abcdefghijklmnop \
  --events ticket_created,ticket_moved

IFTTT

# Trigger IFTTT applet
gira webhook add ifttt https://maker.ifttt.com/trigger/gira_ticket/with/key/YOUR_WEBHOOK_KEY \
  --events ticket_created \
  --filter "priority:critical"

n8n

# Self-hosted n8n workflow
gira webhook add n8n https://n8n.company.com/webhook/gira-integration \
  --events ticket_created,ticket_updated,ticket_moved

🔧 Custom Integrations

Custom REST API

# Basic custom API
gira webhook add custom-api https://api.myservice.com/webhooks/gira \
  --auth bearer --token "${CUSTOM_API_TOKEN}" \
  --events ticket_created,ticket_updated

# Custom API with headers
gira webhook add custom-service https://api.example.com/gira/webhook \
  --auth api_key --api-key "X-API-Key" --api-value "${SERVICE_KEY}" \
  --headers '{"Content-Type": "application/json", "X-Source": "gira", "X-Version": "1.0"}' \
  --events ticket_created,ticket_moved

Database Integration

# Send to database webhook service
gira webhook add database https://db-webhook.company.com/api/tickets \
  --auth basic --username "${DB_USER}" --password "${DB_PASS}" \
  --events ticket_created,ticket_updated,ticket_moved

Microservice Integration

# Notify microservice
gira webhook add microservice https://tickets-service.company.com/webhooks/gira \
  --auth bearer --token "${SERVICE_TOKEN}" \
  --timeout 15 \
  --retry-attempts 5 \
  --events ticket_created,ticket_updated

Email Service

# Send via email service webhook
gira webhook add email-service https://api.sendgrid.com/v3/mail/send \
  --auth bearer --token "${SENDGRID_API_KEY}" \
  --filter "priority:critical" \
  --events ticket_created

🎨 Advanced Patterns

Multi-Environment Setup

# Development environment
gira webhook add slack-dev https://hooks.slack.com/services/.../DEV_WEBHOOK \
  --template slack \
  --filter "labels~development"

# Staging environment  
gira webhook add slack-staging https://hooks.slack.com/services/.../STAGING_WEBHOOK \
  --template slack \
  --filter "labels~staging"

# Production environment
gira webhook add slack-prod https://hooks.slack.com/services/.../PROD_WEBHOOK \
  --template slack \
  --filter "labels~production"

Role-Based Notifications

# Notify team leads of high-priority items
gira webhook add leads-slack https://hooks.slack.com/services/.../LEADS_WEBHOOK \
  --template slack \
  --filter "priority:high OR priority:critical"

# Notify developers of technical tasks
gira webhook add dev-slack https://hooks.slack.com/services/.../DEV_WEBHOOK \
  --template slack \
  --filter "type:bug OR labels~technical"

# Notify product team of features
gira webhook add product-slack https://hooks.slack.com/services/.../PRODUCT_WEBHOOK \
  --template slack \
  --filter "type:feature OR type:epic"

Conditional Workflows

# Security issues → immediate Slack alert + Jira ticket
gira webhook add security-alert https://hooks.slack.com/services/.../SECURITY_WEBHOOK \
  --template slack \
  --filter "labels~security" \
  --events ticket_created

gira webhook add security-jira https://company.atlassian.net/rest/webhooks/1.0/webhook/security \
  --template jira \
  --auth bearer --token "${JIRA_TOKEN}" \
  --filter "labels~security" \
  --events ticket_created

# Completed features → GitHub release + Slack celebration
gira webhook add feature-complete https://api.github.com/repos/owner/repo/dispatches \
  --template github-actions \
  --auth bearer --token "${GITHUB_TOKEN}" \
  --filter "type:feature AND status:done" \
  --events ticket_moved

gira webhook add celebrate-slack https://hooks.slack.com/services/.../CELEBRATE_WEBHOOK \
  --template slack \
  --filter "type:feature AND status:done" \
  --events ticket_moved

Failover and Redundancy

# Primary notification channel
gira webhook add primary-slack https://hooks.slack.com/services/.../PRIMARY_WEBHOOK \
  --template slack \
  --timeout 10 \
  --retry-attempts 2

# Backup notification channel (different workspace)
gira webhook add backup-slack https://hooks.slack.com/services/.../BACKUP_WEBHOOK \
  --template slack \
  --timeout 15 \
  --retry-attempts 3

# Email fallback for critical issues
gira webhook add email-fallback https://api.sendgrid.com/v3/mail/send \
  --auth bearer --token "${SENDGRID_KEY}" \
  --filter "priority:critical" \
  --timeout 20

Aggregation and Batching

# Daily digest webhook (implement batching in receiving service)
gira webhook add daily-digest https://digest.company.com/api/gira/events \
  --auth bearer --token "${DIGEST_TOKEN}" \
  --events ticket_created,ticket_updated,ticket_moved

# Weekly reports
gira webhook add weekly-report https://reports.company.com/api/gira/weekly \
  --auth bearer --token "${REPORTS_TOKEN}" \
  --events sprint_completed

🔍 Testing Your Integrations

Test Individual Webhooks

# Test webhook connectivity
gira webhook test slack

# Test with custom event type
gira webhook test jira-sync --event ticket_created

# Test with verbose output
gira webhook test github-actions --verbose

Health Monitoring

# Check all webhook health
gira webhook health

# Check specific webhook with details
gira webhook health slack --verbose

# Monitor delivery statistics
gira webhook stats

Debug Webhook Issues

# Validate filter expressions
gira webhook filter validate "priority:high AND type:bug"

# Test filter matching
gira webhook filter validate "labels~security OR priority:critical"

# Get filter help
gira webhook filter help

🛠️ Best Practices

Security

  • Use environment variables for sensitive tokens
  • Implement webhook signing verification
  • Rotate API keys regularly
  • Use HTTPS endpoints only

Reliability

  • Set appropriate timeouts (15-30 seconds)
  • Configure retry attempts (3-5 retries)
  • Monitor webhook health regularly
  • Implement fallback mechanisms

Performance

  • Use specific event filters to reduce noise
  • Avoid overly complex filter expressions
  • Monitor delivery statistics
  • Optimize receiving services for webhook loads

Maintenance

  • Document your webhook configurations
  • Test webhooks after service updates
  • Monitor for API changes in external services
  • Keep webhook templates updated

🚀 Next Steps

Ready to build your integration? Copy the examples above and customize them for your services!