This article explains how to make use of the import.properties file to be used along with runFromCsv action in order to eliminate manual corrections to the column names in the CSV file
Instructions
- The propertyFile parameter is used with runFromCsv action to
- allow field (column) name mapping
- allow field specific data mapping values
- The example below shows a use case of removing organization users in a Jira Service Desk project which is retrieved from getOrganizationUserList action
The action below creates a CSV file that has the list of users in an organization.
--action getOrganizationUserList --organization "testorg" --file test.csv
- The generated CSV file looks as shown below
- The action removeOrganizationUsers accepts organization and participants as parameters. As the column User in the CSV file is same as participants, this change can be mentioned in the import.properties file without manually making the change
The import.properties file here maps the field headings (i.e User) to parameters (i.e. participants) that can be understood by the Command Line Interface (CLI).
The left side values are the header names of the CSV file and the right side values are the CLI parameters that are to be mapped.
- The respective column name should be preceded by "field.col_name" (i.e. "field.User" in this case)
Refer to the screenshot of the import.properties file below
Run the below action to delete the list of users which are listed in the CSV file
--action runFromCsv --file "test.csv" --common "-a removeOrganizationUsers" --propertyFile "./src/itest/jira/resources/import.properties"
If the property file is saved in the ACLI client directory, then the name of the file can be directly mentioned. However, if the file is placed somewhere else, then provide the complete path of the file location
- The use of properties file helps automate the processes eliminating manual interruptions of modifying the CSV input file header names to parameter names that are accepted by the CLI.