Jira Add Comment Sink
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Adds the text of each message as a new comment to an existing issue in Jira.
Use it to record on a ticket what happened elsewhere, for example a deployment, the result of a build or a reply of a customer. To create issues use jira-add-issue-sink, to change their fields jira-update-issue-sink, and to change their status jira-transition-issue-sink.
Input: the body is the text of the comment, as text. The ce-issueKey header, the key of the issue such as SHOP-42, is required. Set it before this sink, for example with insert-header-action.
Output: the message is unchanged.
Good to know: a message without ce-issueKey, or for an issue that does not exist or that the user cannot see, fails. The comment is written in the name of the account the Kamelet logs in with. Log in either with username and password, or with personal-token. Headers that start with CamelJira are removed from the message first, so they cannot change what the Kamelet does.
Configuration Options
The following table summarizes the configuration options available for the jira-add-comment-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Jira URL | Required The address of your Jira, as you open it in a browser, without a path. | string | https://mycompany.atlassian.net | ||
Password | The password of | string | |||
Personal Token | A personal access token, for Jira Server and Jira Data Center; create one in Jira under your profile, Personal Access Tokens. Use it instead of | string | |||
Username | The user to log in as, together with | string |
Dependencies
At runtime, the jira-add-comment-sink Kamelet relies upon the presence of the following dependencies:
-
camel:jackson3
-
camel:jira
-
camel:kamelet
-
mvn:tools.jackson.datatype:jackson-datatype-joda:3.2.4
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel Supposing 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:jira-add-comment-sink" You can now run it directly through the following command
camel run route.yaml Jira Add Comment Sink Kamelet Description
Input Format
The body is the text of the comment, as text. The ce-issueKey header names the issue, such as SHOP-42, and is required: a message without it fails.
Authentication
Use one of the two ways to log in:
-
Jira Cloud: set
usernameto the email address of the account, andpasswordto an API token of that account. -
Jira Server and Jira Data Center: set
personal-tokento a personal access token, and leaveusernameandpasswordempty.
The comment is written in the name of the account the Kamelet logs in with.
Usage example
The route below adds a comment to the issue SHOP-42.
- route:
from:
uri: "kamelet:timer-source"
parameters:
message: "Version 2.3.1 with the fix is deployed to production."
repeatCount: 1
steps:
- setHeader:
name: ce-issueKey
constant: SHOP-42
- to:
uri: "kamelet:jira-add-comment-sink"
parameters:
jiraUrl: "https://mycompany.atlassian.net"
username: "me@mycompany.com"
password: "{{jira.apiToken}}"