Running a script to populate the System Title field (Cloud Pak for Data)

You can use a script to populate the Title (System Fields:Title) field with values from another field. This task applies to IBM OpenPages for IBM Cloud Pak for Data.

Before you begin

About this task

After you enable the System Title field for an object type, you can use a script to populate the field with values from another field.

This task is optional.

Review the following notes before you run the script:
  • The script updates the Title field whether or not an object instance is locked.
  • For files (SOXDocument), the script updates the Title field whether or not the file is checked out.
  • If you want to use the Title field in Cognos® reports, you must regenerate the reporting framework after you enable the Title field for the object type.
  • In Cognos, the Name query item contains the ID (System Fields:Name) and the Title query item contains the Title (System Fields:Title).

    For example, for the Issue object type, the query items are called Issue Name and Issue Title.

Procedure

  1. If System Admin Mode is enabled, disable it.
  2. Get the required files:
    1. Log in and change to the project where the OpenPages instance is installed.
    2. Exec into the application server pod:
      oc exec -it openpages-<instance_name>-sts-0 bash
    3. Run the following command:
      cd /opt/ibm/OpenPages/system-field-update-scripts
    The directory contains the following files:
    • system_title_field_copy.env – Sets the parameters for the script
    • system_title_field_copy.sh – Script that populates the Title field.
  3. Modify the system_title_field_copy.env file to set the parameters for the script.

    Change the values after the equal sign. Do not make any other changes to the file.

    The file provides instructions on how to set the parameters.

    Note: Modify only the .env file. Do not modify the .sh, .bat, or .sql files.
    If you're using the database that is provided with OpenPages, use the following values for the database parameters:
    • op_db_user=openpage
    • db_connect_alias=OPX
    If you're using an external database, use the following values for the database parameters:
    • op_db_user: The OpenPages database schema user.
    • db_connect_alias: The alias of the OpenPages database, for example: extdb.
  4. If you're using the database that is provided with OpenPages, get the database password by running the following command:
    oc get secret openpages-<instance_name>-db-secret -o jsonpath="{.data['openpage-pw']}" | base64 -d
  5. From the application container, run the system_title_field_copy.sh script.

    Replace <op_db_password> with the secret that you retrieved in step 4. Or if you're using an external database, use the password of the OpenPages database schema user.

    ./system_title_field_copy.sh <op_db_password>