PutJiraIssue 2.3.0.4.10.0.0-147

Bundle
com.cloudera | nifi-cdf-jira-processors-nar
Description
This processor creates issues on a Jira server or cloud service. A JSON with the issues definition must be provided as an incoming FlowFile.
Tags
issue, jira, put
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
  • Additional Details for PutJiraIssue 2.3.0.4.10.0.0-147

    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.
    • Dynamic Property Value: @{/inputJson/…/value} - Multi-type format, it can either be a simple plain value, EL 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: /fields/extraFields/code
    2. Dynamic Property 1 Value: @{/secret_code}

    Note: The first token, “fields” is fixed and mandatory, it denotes that the extraFields field will be set.

    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"
                    }
                }
            }
            
    
Properties
Dynamic Properties
Relationships
Name Description
success For FlowFiles created as a result of a successful execution.
failure For FlowFiles created as a result of an execution error.
Writes Attributes
Name Description
mime.type Sets the MIME type to application/json
error.message The error message returned by PutJiraIssue.
record.count The number of records processed.
jira.issue.id The ID of the Jira issue. In case of multiple records corresponds to the ID of the latest response.
jira.issue.key The key of the Jira issue. In case of multiple records corresponds to the key of the latest response.
jira.issue.self The link of the canonical location of the issue. In case of multiple records corresponds to the canonical location of the latest response.
See Also