PutJiraIssue

Description

This processor uses Jira REST API to create a new issue in JIRA. The user may set the basic properties of an issue: the Project Key, the Issue Summary, the Issue Description and the Issue Type. The Project Key can be found in Jira under Project Settings. Issue Types must be created first in Jira before creating a tasks with one. Additional Jira issue attributes can be supplied through Dynamic Properties on the processor.

Authentication

The Jira server may require the client to authenticate itself, in order to create new issues in Jira. This processor supports authentication through Personal Access Token, in case of Jira Server, and user e-mail & API token, in case of Jira Cloud. The credential must be provided in the same format, as Jira presents it to the user. Providing an invalid token might result in either error messages, or empty responses, depending on the access policy configuration on the server side.

Multi-type properties

The following properties can be plain strings, EL expressions and RecordPaths. In case of RecordPath evaluation the @{Property Value} format shall be used. First always the Expression Language is evaluated, then the RecordPath.

  1. Project Key
  2. Issue Summary
  3. Issue Description
  4. Issue Type

Additional Dynamic Properties can be defined on the processor in the following format to supply custom Jira attributes:

  1. Dynamic Property Key: /jira/additionalProperties/0/additionalProperty - JsonPointer expression which specifies the JSON path the value will be inserted to. It is important to notice that the array notation differs from the RecordPath expressions. E.g. /project/addresses/0/street.
  2. Dynamic Property Value: @{/inputJson/.../value} - Multi-type format, it can either be a simple plain value or a RecordPath that directs to the field within the incoming records. This field will then be placed into the location specified by the Dynamic Property Key.

Examples

This is how the basic JSON looks like that the processor sends to JIRA. In case a Record Reader is not set, this is the expected format of the incoming FlowFile. More examples can be found here here.

        {
            "fields": {
                "project": {
                    "key": "TEST_PROJECT_KEY"
                },
                "summary": "Test summary.",
                "description": "This is a test issue from PutJiraIssue.",
                "issuetype": {
                    "name": "Task"
                }
            }
        }
        


When Record Reader is set, the 'Project Key', 'Issue Summary', 'Issue Description' and 'Issue Type' properties can be used to either extract values from the incoming records or provide constant values. The processor will construct a Json based on these property values and send it to the Jira platform for issue creation. In this example based on the incoming records, we set the "project/key", "summary", "description" and "issuetype" attributes of the JSON above. If there's an incoming FlowFile with the following content:

        {
            "name": "John Doe",
            "project_id": "DEV",
            "secret_code": "Batman",
            "tasks": [
                {
                    "title": "Develop PutJiraIssue",
                    "description": "Code day and night until it's done.",
                    "type": "Feature"
                }
            ]
        }
    


The most important issue properties should be set first on the processor:
  1. Project Key: @{/project_id}
  2. Issue Summary: @{/tasks[0]/title}
  3. Issue Description: @{/tasks[0]/description}
  4. Issue Type: @{/tasks[0]/type}
We're also going to define a Dynamic Property.
  1. Dynamic Property 1 Key: /extraFields/code
  2. Dynamic Property 1 Value: @{/secret_code}
The final JSON then is sent to the JIRA server for task creation.

        {
            "fields": {
                "project": {
                    "key": "DEV"
                },
                "summary": "Develop PutJiraIssue",
                "description": "Code day and night until it's done.",
                "issuetype": {
                    "name": "Feature"
                },
                "extraFields": {
                    "code": "Batman"
                }
            }
        }