REST API - retrieving the successors of a job stream in the plan

Use REST APIs to retrieve the list of a job stream successors.

About this task

This process involves finding the unique ID of a job stream in the plan and then using that ID to query for other jobs and job streams that depend on it.

Procedure

  1. First, get the unique ID of the job stream for which you want to find successors. Use the GET/twsd/api/v2/plan/jobstream endpoint to find your job stream.
    1. In the Swagger UI, expand the endpoint. Use the filters or the oql string parameter to locate the job stream.
    2. Click Execute.
    3. From the API response, copy and save the job stream id.

      Example of a response payload:

      {
        "flowNodeType": "JOBSTREAM",
        "id": "9daec769-39e0-3283-9006-2933c84d3c78",
        "planId": "57c9a3d5-e6a0-3f0d-96c4-c65602a069b2",
        "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
        "folder": "/",
        "name": "FINALPOSTREPORTS",
        "workstationId": "af930748-42c6-3440-be71-4d9ee1050130",
        "workstation": "/RMMYCLDTL4267_XA",
        ...
      }
  2. Now, use the ID you copied to find all successors. You must query two endpoints to get a complete list of both jobs and job streams that depend on your target job stream.
    1. To find successor jobs, use the GET/twsd/api/v2/plan/job endpoint. In the oql parameter field, enter the following query, replacing the example ID with your job stream ID:
      dependencies.jobStreamId = '9daec769-39e0-3283-9006-2933c84d3c78'
    2. To find successor *job streams, use the GET/twsd/api/v2/plan/jobstream endpoint with the same oql filter.
    3. Click Execute for each request.

Results

The API responses for each call contain the lists of jobs and job streams that are successors to your target job stream.