Kamelet Catalog

jira oauth source Jira oauth Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Stable"

Receives each new Jira issue that matches a JQL query, such as every new bug of a project, by asking Jira at a regular interval, and logs in with OAuth 1.0a.

Use it to react to new tickets of a Jira Server or Data Center where an administrator has set up an application link with OAuth for your integration, for example to tell a team chat about a new bug. To log in with a user and an API token or a personal access token, which is simpler, use jira-source.

Output: the body is the issue as JSON text, with fields such as key, summary, description, status, issueType, project, reporter, assignee and priority.

Good to know: only the issues created after the Kamelet starts are sent; the issues that already exist are not, and neither are changes to an issue. It checks every 6 seconds. The four OAuth values come from the OAuth 1.0a authorization of the application link, see each option.

Configuration Options

The following table summarizes the configuration options available for the jira-oauth-source Kamelet:

Property Name Description Type Default Example

accessToken

Access Token

Required The OAuth access token that Jira gives at the end of the OAuth 1.0a authorization, when the user has allowed the access.

string

consumerKey

Consumer Key

Required The consumer key of the application link, as an administrator entered it in Jira under Application Links, for incoming authentication.

string

jiraUrl

Jira URL

Required The address of your Jira, as you open it in a browser, without a path.

string

https://jira.mycompany.com

jql

JQL

Required The JQL query that selects the issues to send, as in the advanced issue search of Jira, without ORDER BY.

string

project = SHOP AND issuetype = Bug

privateKey

Private Key

Required The RSA private key whose public key is set in the application link, in PKCS8 format and Base64 encoded, on one line, without the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines.

string

verificationCode

Verification Code

Required The verification code (verifier) that Jira shows when the user allows the access, in the middle of the OAuth 1.0a authorization.

string

Dependencies

At runtime, the jira-oauth-source 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:jira-oauth-source"
      parameters:
        .
        .
        .
      steps:
        - to:
            uri: "kamelet:log-sink"

You can now run it directly through the following command

camel run route.yaml

Jira oauth Source Kamelet Description

Authentication methods

This Kamelet uses OAuth 1.0a to connect to JIRA, through an application link that a Jira administrator sets up for incoming authentication. You need to provide:

  • consumerKey: the consumer key of the application link

  • privateKey: the RSA private key whose public key is set in the application link, in PKCS8 format, Base64 encoded on one line, without the BEGIN and END lines

  • verificationCode: the verification code (verifier) that Jira shows when the user allows the access

  • accessToken: the access token that Jira gives at the end of the authorization

  • jiraUrl: the address of your Jira

To log in with a user and an API token, or with a personal access token, use jira-source instead.

Output format

The Kamelet sends each new issue that matches the JQL query as one message, with the issue as JSON text. Only the issues created after the Kamelet starts are sent. It checks for new issues every 6 seconds.

Configuration

The Kamelet requires the following parameters:

  • jiraUrl: The address of your Jira

  • accessToken: The access token generated by the JIRA server

  • verificationCode: The verification code generated by the JIRA server

  • consumerKey: The consumer key of the application link

  • privateKey: The private key whose public key is set in the application link

  • jql: The JQL query that selects the issues, without ORDER BY

Usage example

- route:
    from:
      uri: "kamelet:jira-oauth-source"
      parameters:
        jiraUrl: "https://jira.mycompany.com"
        accessToken: "{{jira.accessToken}}"
        verificationCode: "{{jira.verificationCode}}"
        consumerKey: "{{jira.consumerKey}}"
        privateKey: "{{jira.privateKey}}"
        jql: "project = SHOP"
      steps:
        - to:
            uri: "kamelet:log-sink"