Export Setup Data for a Task

You have completed some modifications for a setup task and want to export the setup data to move it to a test or production environment. This use case takes you through the steps in using the Setup Task CSV Exports resource to export the setup data. Before you begin, you must identify the code of the task that you want to migrate. For instructions, see topic Automate Export and Import of CSV File Packages.

In this example, the task code is HZ_MANAGE_RESOURCE_ROLES. Let's look at the steps.

  1. Start the export process: Submit a request to start the export process using the setupTaskCSVExports resource.
    curl -i -u "<username>:<password>" -X POST https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/setupTaskCSVExports
    Content-Type: application/vnd.oracle.adf.resourceitem+json

    Sample Request Payload

    {
      "TaskCode" : "HZ_MANAGE_RESOURCE_ROLES",
      "SetupTaskCSVExportProcess" : [{  "TaskCode" : "HZ_MANAGE_RESOURCE_ROLES"  }]
    }

    The export process starts and a process ID is generated.

    Sample Response Payload

    {
        "TaskCode": "HZ_MANAGE_RESOURCE_ROLES",
         ...     
        "SetupTaskCSVExportProcess": [
            {
                "ProcessId": 300100022143402,
                ...
            }
        ],
            ...
    }
  2. Check the process status: Send a request using the process ID to check if the export process is completed.
    curl -i -u "<username>:<password>" -X GET https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/setupTaskCSVExports/HZ_MANAGE_RESOURCE_ROLES/child/SetupTaskCSVExportProcess/300100022143402

    You get the response value as true or false.

    Sample Response Payload

    {
      "ProcessId": 300100022143402,
      "ProcessCompletedFlag": true,
      ...
      
    }
  3. Retrieve the export process results: After the export process is complete, send this request to download the .zip file containing the exported setup data.
    curl -i -u "<username>:<password>" -X GET https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/setupTaskCSVExports/HZ_MANAGE_RESOURCE_ROLES/child/SetupTaskCSVExportProcess/300100022143402/child/SetupTaskCSVExportProcessResult/300100022143402/enclosure/FileContent

    Sample Response Payload

    The response is a base64 encoded string that you can download in the form of a .zip file.

    You can download the .zip file and examine the offering setup data.