tJIRAOutput
tJIRAOutput Standard properties
These properties are used to configure tJIRAOutput running in the Standard Job framework.
The Standard
tJIRAOutput component belongs to the Business family.
The component in this framework is available in all Talend
products.
Basic settings
Host URL |
Specify the URL used to access JIRA. |
User Id and Password |
Specify the user authentication data used to access JIRA. To enter the password, click the […] button next to the |
JIRA resource |
Select the JIRA resource from the drop-down |
Schema and Edit schema |
A schema is a row description. It defines the number of fields Note that the schema of this component is |
Output Action |
Select an operation to be performed from the drop-down list.
|
Advanced settings
Delete subtasks |
Select this check box to delete the subtask(s). This check box is available only when ISSUE is selected from the JIRA |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
Global Variables |
NB_LINE: the number of rows processed. This is an After
NB_SUCCESS: the number of rows successfully processed.
NB_REJECT: the number of rows rejected. This is an After
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component is usually used as an end component of a Job or |
Creating an issue in JIRA application
issue in JIRA application, then retrieve the information of the new issue from JIRA
application, finally extract the information needed based on the JSONPath query and write the
extracted information into a JSON file.
Setting up a Job for creating an issue in JIRA application
A project with the key DOC has been created in JIRA
application and only one issue with the key DOC-1 has already
been created under this project.
-
Create a new Job and add a tFileInputDelimited
component, a tJIRAOutput component, a
tJIRAInput component, a
tExtractJSONFields component, and a
tFileOutputJSON component to the Job. -
Double-click the tJIRAOutput component to open its
Basic settings view. -
Select Issue from the JIRA
resource drop-down list and Insert from
the Output Action drop-down list to insert an
issue. -
Link the tFileInputDelimited component to the
tJIRAOutput component using a Row > Main connection. In the pop-up dialog box, click
Yes to let the
tFileInputDelimited component get the schema of the
tJIRAOutput component. -
Do the same to link the tJIRAInput component to the
tExtractJSONFields component and the
tExtractJSONFields component to the
tFileOutputJSON component. -
Link the tFileInputDelimited component to the
tJIRAInput component using a Trigger > On Subjob Ok connection.
Creating a new issue in JIRA application
-
Double-click the tFileInputDelimited component to open
its Basic settings view. -
In the File name/Stream field, specify the path to the
JSON file used to create the issue.In this example, a simple JSON file
D:/JiraComponents/issue_create.json will be used
to insert a new issue under the project with the key
DOC and the data in this file reads as
follows:123456789101112{"fields": {"issuetype": {"id": "10001","name": "Task"},"project": {"key": "DOC","name": "Documentation"},"description": "Create an issue under the DOC project","summary": "Add the documentation for new components tJIRA***"}}Note that the tJIRAOutput component now only supports
creating project/issue in JIRA application with the single line JSON file,
so you need to join all lines in the input JSON file into one line before
executing the Job.For more information about the types of issues, see the JIRA official
documentation Issue types.For more information about how to find the id for issue types, see the JIRA
official documentation Finding the Id for Issue
Types. -
Double-click the tJIRAOutput component to open its
Basic settings view. -
In the Host URL, User Id, and
Password fields, specify the user authentication
information required to access the JIRA application.
Retrieving the new issue information from JIRA application
-
Double-click the tJIRAInput component to open its
Basic settings view. -
Select Issue from the JIRA
resource drop-down list. -
In the JQL field, enter the JQL query used to retrieve
issues in JIRA application.In this example, the query is project = DOC ORDER BY created
DESC. All issues under the project DOC
will be retrieved and they will be sorted by the creation date in descending
order. -
Double-click the tExtracJSONFields component to open its
Basic settings view. -
Click the […] button next to Edit
schema, and in the schema dialog box displayed, define the
schema by adding five columns of String type, id,
key, project,
description, and summary,
which will hold the corresponding information of each issue retrieved.When done, click OK to save the changes and close the
dialog box. -
Select the JSON field to be extracted from the JSON
field drop-down list. In this example, it is
json, which is passed from the
tJIRAInput component. -
In the Loop Jsonpath query field, specify the path to
the node on which the loop is based. In this example, it is
$, which is the root node of the JSON field. -
In the Mapping table, the Column
cells are automatically filled with the schema columns, and you need to specify
the corresponding JSON node that holds the desired data for each schema column.
In this example, $.id for the id
column, $.key for the key column,
$.fields.project.key for the
project column,
$.fields.description for the
description column, and
$.fields.summary for the
summary column. -
Double-click the tFileOutputJSON component to open its
Basic settings view. -
In the File Name field, specify the path to the file
into which the extracted issue information will be written,
D:/JiraComponents/issue_info.json in this example.
And in the Name of data block field, enter the name of
the data block, issue in this example.
Executing the Job to create an issue in JIRA application
- Press Ctrl + S to save the Job.
- Press F6 to execute the Job.
-
Open the JSON file issue_info.json generated.
Note that all extracted issue information is displayed in one line in the
generated JSON file, and you can use some editor tool to format and indent
the data into an organized manner for better display of the result.As shown above, a new issue with the key DOC-2 has
been created, and the desired information for each issue in the project
DOC has been successfully extracted and written
into the JSON file.
Updating an issue in JIRA application
existing issue in JIRA application, then retrieve the information of the updated issue from
JIRA application, finally extract the information needed based on the JSONPath query and write
the extracted information into a JSON file.
Creating a Job for updating an issue in JIRA application
A project with the key DOC has been created in JIRA
application and an issue with the key DOC-2 as shown below
has already been created under this project.
-
Create a new Job and add a tFileInputDelimited
component, a tJIRAOutput component, a
tJIRAInput component, a
tExtractJSONFields component, and a
tFileOutputJSON component to the Job. -
Double-click the tJIRAOutput component to open its
Basic settings view. -
Select Issue from the JIRA
resource drop-down list and Update from
the Output Action drop-down list to update an
issue. -
Link the tFileInputDelimited component to the
tJIRAOutput component using a Row > Main connection. In the pop-up dialog box, click
Yes to let the
tFileInputDelimited component get the schema of the
tJIRAOutput component. -
Do the same to link the tJIRAInput component to the
tExtractJSONFields component and the
tExtractJSONFields component to the
tFileOutputJSON component. -
Link the tFileInputDelimited component to the
tJIRAInput component using a Trigger > On Subjob Ok connection.
Updating an issue in JIRA application
-
Double-click the tFileInputDelimited component to open
its Basic settings view. -
In the File name/Stream field, specify the path to the
JSON file used to update the issue.In this example, a simple JSON file
D:/JiraComponents/issue_update.json will be used
to update an existing issue with the key DOC-2 that
is under the DOC project, and the data in this file
reads as follows:12345DOC-2;{"fields": {"description": "Update an issue under the DOC project","summary": "Add the documentation for new components tJIRAInput and tJIRAOutput"}}Note that the tJIRAOutput component now only supports
updating project/issue in JIRA application with the single line JSON file,
so you need to join all lines in the input JSON file into one line before
executing the Job. -
Double-click the tJIRAOutput component to open its
Basic settings view. -
In the Host URL, User Id, and
Password fields, specify the user authentication
information required to access the JIRA application.
Retrieving the updated issue information from JIRA application
-
Double-click the tJIRAInput component to open its
Basic settings view. -
Select Issue from the JIRA
resource drop-down list. -
In the JQL field, enter the JQL query used to retrieve
the issue in JIRA application.In this example, the query is project = DOC AND issuekey =
DOC-2. The issue with the key DOC-2 under
the project DOC will be retrieved. -
Double-click the tExtracJSONFields component to open its
Basic settings view. -
Click the […] button next to Edit
schema, and in the schema dialog box displayed, define the
schema by adding five columns of String type, id,
key, project,
description, and summary,
which will hold the corresponding information of each issue retrieved.When done, click OK to save the changes and close the
dialog box. -
Select the JSON field to be extracted from the JSON
field drop-down list. In this example, it is
json, which is passed from the
tJIRAInput component. -
In the Loop Jsonpath query field, specify the path to
the node on which the loop is based. In this example, it is
$, which is the root node of the JSON field. -
In the Mapping table, the Column
cells are automatically filled with the schema columns, and you need to specify
the corresponding JSON node that holds the desired data for each schema column.
In this example, $.id for the id
column, $.key for the key column,
$.fields.project.key for the
project column,
$.fields.description for the
description column, and
$.fields.summary for the
summary column. -
Double-click the tFileOutputJSON component to open its
Basic settings view. -
In the File Name field, specify the path to the file
into which the extracted issue information will be written,
D:/JiraComponents/issue_info_update.json in this
example. And in the Name of data block field, enter the
name of the data block, issue in this example.
Executing the Job to update an issue in JIRA application
- Press Ctrl + S to save the Job.
- Press F6 to execute the Job.
-
Open the JSON file issue_info_update.json generated.
Note that all extracted issue information is displayed in one line in the
generated JSON file, and you can use some editor tool to format and indent
the data into an organized manner for better display of the result.As shown above, the issue with the key DOC-2 has been
updated, and the desired information for the issue has been successfully
extracted and written into the JSON file.