ZAMMAD + WEBHOOK

Install https://golangrepo.com/repo/adnanh-webhook-go-devops-tools

Create a cert with openssl.

Create an executable script.

Create the one who rules all: hooks.json >>>

[
  {
    "id": "webhook_bbr_approved",
    "execute-command": "/usr/local/homegrown/webhooks/execute.sh",
    "command-working-directory": "/usr/local/homegrown/webhooks/output",
    "pass-arguments-to-command":
    [
      {
        "source": "string",
        "name": "bbr"
      },
      {
        "source": "string",
        "name": "approved"
      },
      {
        "source": "payload",
        "name": "ticket.customer.firstname"
      },
      {
        "source": "payload",
        "name": "ticket.customer.lastname"
      },
      {
        "source": "payload",
        "name": "ticket.customer.degree"
      },
      {
        "source": "payload",
        "name": "ticket.customer.email"
      },
      {
        "source": "payload",
        "name": "ticket.customer.street"
      },
      {
        "source": "payload",
        "name": "ticket.customer.city"
      },
      {
        "source": "payload",
        "name": "ticket.customer.zip"
      },
      {
        "source": "payload",
        "name": "ticket.customer.country"
      },
      {
        "source": "payload",
        "name": "ticket.customer.gender"
      },
      {
        "source": "payload",
        "name": "ticket.customer.salutation"
      },
      {
        "source": "payload",
        "name": "ticket.price"
      },
      {
        "source": "payload",
        "name": "ticket.host"
      },
      {
        "source": "payload",
        "name": "ticket.show"
      },
      {
        "source": "payload",
        "name": "article.created_by.lastname"
      }
    ]
  }
]

Run

webhook -hooks hooks.json -verbose -secure -cert certs/webhook.pem -key certs/webhook.key

Call i.e. https://webhook.mydomain.tld:9000/hooks/webhook_bbr_approved as webhook from zammad.

Passing fixed arguments to your executed shell script:

      {
        "source": "string",
        "name": "bbr"
      },

The values are dropping into your shell script as arguments.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.