Skip to end of banner
Go to start of banner

How to configure a properties file to be used with runFromCsv in Jira Command Line Interface (CLI)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

This article explains how to make use of the import.properties file along with the runFromCsv action in order to eliminate the manual corrections to the column names in the CSV file.

Instructions

  1. The propertyFile parameter is used with runFromCsv action for these purposes:
    1. To allow the column/field name mapping.
    2. To allow the data mapping with the field-specific values.
  2. The below use case shows, how to remove the users from the organization, in a Jira Service Desk project which can be retrieved through the getOrganizationUserList action.
    1. The below action creates a CSV file that has the list of users in an organization.

      --action getOrganizationUserList --organization "testorg" --file test.csv
      1. The generated CSV file looks as shown below:
    2. The action removeOrganizationUsers accepts organization and participants as parameters. As the column User in the CSV file is the same as participants, this change can be mentioned in the import.properties file without manually making the change
    3. The import.properties file here map the field headings (i.e User) to parameters (i.e. participants) that can be understood by the Command Line Interface (CLI).

    4. 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.

    5. The respective column name should be preceded by "field.col_name" (i.e. "field.User" in this case)
    6. Refer to the screenshot of the import.properties file below

    7. 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

    8. 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.


It is recommended to test this scenario in a non-production environment or run the action with the --simulate parameter, to verify the behavior before deploying on a production environment.
  • No labels