To launch the User portal with the list of cases created for a particular Job ID from an API call in Pega, you can follow these steps:
- Create a new API rule in Pega that can accept the external system’s API call. To create the API rule, you can navigate to Designer Studio > Integration > Services and Connectors > REST and create a new REST Integration.
- Define the input parameters for the API, including the Job ID that the external system will be sending in the header.
- In the API rule, use the Job ID to retrieve the list of cases created for that particular Job ID. You can use a data page or a report definition to retrieve the list of cases.
- Once you have the list of cases, you can create a URL that will launch the User portal with the filtered list of cases. The URL should include the following parameters:
- pyDefaultFilter=<filter condition to retrieve cases based on the Job ID>
The pyDefaultFilter parameter should be set to a filter condition that retrieves cases based on the Job ID. For example, if the Job ID is stored in a property called “JobID” on the case, the filter condition should be: pyDefaultFilter=JobID='<Job ID>’
- Return the URL to the external system as the response to the API call.
- The external system can then launch the User portal by opening the URL in a browser. The User portal will open with the filtered list of cases for the specified Job ID.
Note: Make sure that the user who is launching the User portal has the appropriate privileges to access the cases.