Chapter 35. Jira Add Issue Sink
Add a new issue to Jira.
The Kamelet expects the following headers to be set:
-
projectKey/ce-projectKey: as the Jira project key. -
issueTypeName/ce-issueTypeName: as the name of the issue type (example: Bug, Enhancement). -
issueSummary/ce-issueSummary: as the title or summary of the issue. -
issueAssignee/ce-issueAssignee: as the user assigned to the issue (Optional). -
issuePriorityName/ce-issuePriorityName: as the priority name of the issue (example: Critical, Blocker, Trivial) (Optional). -
issueComponents/ce-issueComponents: as list of string with the valid component names (Optional). -
issueDescription/ce-issueDescription: as the issue description (Optional).
The issue description can be set from the body of the message or the issueDescription/ce-issueDescription in the header, however the body takes precedence.
To authenticate, a username/password or personal token must be defined. We recommend to use personal token as it is a safer way to get access to Jira.
35.1. Configuration Options Copy linkLink copied to clipboard!
The following table summarizes the configuration options available for the jira-add-issue-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
| jiraUrl * | Jira URL | The URL of your instance of Jira | string | ||
| password | Password | The password to access Jira | string | ||
| personal-token | Personal Token | Personal Token | string | ||
| username | Username | The username to access Jira | string |
* = Fields marked with an asterisk are mandatory.
35.2. Dependencies Copy linkLink copied to clipboard!
35.2.1. Quarkus dependencies Copy linkLink copied to clipboard!
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-core</artifact>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-jackson</artifact>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-jira</artifact>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-kamelet</artifact>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifact>jackson-datatype-joda</artifact>
<version>2.12.5</version>
</dependency>
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifact>camel-kamelets-utils</artifact>
<version>4.8.5</version>
</dependency>
</dependencies>
35.3. Usage Copy linkLink copied to clipboard!
35.3.1. Camel JBang usage Copy linkLink copied to clipboard!
35.3.1.1. Prerequisites for JBang Copy linkLink copied to clipboard!
- Install JBang.
You have executed the following command:
jbang app install camel@apache/camel
35.3.1.2. Running a route with JBang Copy linkLink copied to clipboard!
Suppose you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command.
camel run route.yaml
35.3.2. Knative Sink Copy linkLink copied to clipboard!
You can use the jira-add-issue-sink Kamelet as a Knative sink by binding it to a Knative object.
jira-add-issue-sink-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: jira-add-issue-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "projectKey"
value: "MYP"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issueTypeName"
value: "Bug"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issueSummary"
value: "The issue summary"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issuePriorityName"
value: "Low"
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
properties:
jiraUrl: "jira server url"
username: "username"
password: "password"
35.3.3. Kafka Sink Copy linkLink copied to clipboard!
You can use the jira-add-issue-sink Kamelet as a Kafka sink by binding it to a Kafka topic.
jira-add-issue-sink-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: jira-add-issue-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "projectKey"
value: "MYP"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issueTypeName"
value: "Bug"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issueSummary"
value: "The issue summary"
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: insert-header-action
properties:
name: "issuePriorityName"
value: "Low"
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
name: jira-add-issue-sink
properties:
jiraUrl: "jira server url"
username: "username"
password: "password"