Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

This guides explains how read a topic in Kafka using Integrations Hub for Jira and create a ticket in Jira or update a ticket.

First step is to create an inbound integration, this will allow iHub to read messages posted on the Kafka queue. That is called the WHEN section of the inbound integration. On the THEN section you will need to specify the Action that iHub will do in Jira. Actions in the THEN sections are defined in the outbound integrations menu. So the inbound integration will pass the data received down to a outbound action, in many cases there is also a need to route it to the correct outbound integration based on a condition in the message received, this is done in the IF section.

The outbound message defined in this tutorial is one for Create Issue and one for Updating an Issue. This is part 2 of the tutorial.

Step 1 - Add Inbound Integration

Goto Inbound Integrations and click Create Rule and select Kafka

  1. Enter the Kafka Topic name to read from

  2. Enter the Key and Value deserializer.

  3. Select the Action that shall take the input from each Kafka message and perform something in Jira.

  4. optional specify a Data condition

Step 2. - Add Outbound Integration to creata a Jira Issue

  1. Click New (Action)

  2. Select Template Category: Jira Core

  3. Select Template: Create Issue

  4. Click Create

  5. Select a basic Auth Jira user see Basic Auth

  6. Add Body

    {
        "fields": {
            "project": {
                "id": "12200"
            },
            "summary": "{{name}}",
            "issuetype": {
                "id": "10001"
            },
            "reporter": {
                "name": "kg"
            },
            "labels": [
                "kafka"
            ],
            "description":"{{description}}",
            "customfield_10201":"{{someother_data}}"
        }
    }
    

This will create the issue based on the incoming data from Kafka. In the message we are sending

{
  "name":"the issue name",
  "description":"some description",
  "someother_data":"100"
}

the data in the message gets converted to an object that we can access using mustache syntax {{name}} etc.

Step 3. - Add Outbound Integration to update a Jira Issue

  1. Click New (Action)

  2. Select Template Category: Jira Core

  3. Select Template: Edit Issue

  4. Click Create

  5. Change the URL {{baseUrl}}/rest/api/2/issue/{{issue.key}} to {{baseUrl}}/rest/api/2/issue/{{key}}

  6. Select a basic Auth Jira user see Basic Auth

  7. Add Body

    {
        "fields": {        
            "description":"{{description}}",
            "customfield_10201":"{{someother_data}}"
        }
    }
    

This will create the issue based on the incoming data from Kafka. In the message we are sending

{
  "key":"ISSUE-1234",
  "description":"new description",
  "someother_data":"945"
}

the data in the message gets converted to an object that we can access using mustache syntax {{key}} which is used for updating the issue

  • No labels