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

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

About this task

This process involves retrieving a job stream data from the plan and then inspecting its dependencies field to identify all its predecessors.

Procedure

  1. First, get the data for the job stream for which you want to find predecessors. Use the GET/twsd/api/v2/plan/jobstream endpoint.
    1. In the Swagger UI, expand the endpoint. Use the filters or the oql string parameter to locate your target job stream.
    2. Click Execute.
    3. From the API response, locate the dependencies array in the response body. This array contains the IDs of all predecessor jobs and job streams.

      Example of a response payload showing the dependencies array:

      JSON
      
      {
        "flowNodeType": "JOBSTREAM",
        "id": "9daec769-39e0-3283-9006-2933c84d3c78",
        "planId": "57c9a3d5-e6a0-3f0d-96c4-c65602a069b2",
        ...
        "dependencies": [
          {
            "dependencyType": "EXTERNAL_JOB",
            "id": "612f1cd8-89a8-30c0-ab27-da8f5c89b0d3",
            "dependencyStatus": "UNDECIDED",
            "jobId": "612f1cd8-89a8-30c0-ab27-da8f5c89b0d3",
            "jobName": "SWITCHPLAN",
            "jobStreamId": "659aa50d-8128-3d11-9977-8390004c2a06",
            "jobStreamName": "FINAL",
            "jobStreamWorkstation": "/RMMYCLDTL4267_XA",
            "jobStreamSchedTime": "2025-10-13T21:59:00Z",
            "jobStreamFolder": "/",
            "folderOriginalName": "RMMYCLDTL4267_XA",
            "jobStreamSuccId": "9daec769-39e0-3283-9006-2933c84d3c78",
            "pending": false,
            "zombie": false
          }
        ],
        "dependenciesStats": {
          "numberOfDependencies": 1,
          "numberOfJobDependencies": 1,
          "numberOfJobStreamDependencies": 0,
          "numberOfInternetworkDependencies": 0,
          "numberOfPromptDependencies": 0,
          "numberOfResourceDependencies": 0,
          "numberOfFileDependencies": 0,
          "numberOfUnresolvedDependencies": 1,
          "numberOfNonResourceUnresolvedDependencies": 1,
          "numberOfCompletedDependencies": 0,
          "numberOfSuccessors": 0
        },
        ...
      }
  2. For each entry in the dependencies array, use its jobId or jobStreamId to retrieve the full details of that predecessor.
    1. To get a predecessor job details, use the GET/twsd/api/v2/plan/job/{job_id} endpoint, pasting the jobId from the array into the ID parameter.
    2. To get a predecessor job stream details, use the GET/twsd/api/v2/plan/jobstream/{jobstream_id} endpoint, pasting the jobStreamId from the array into the ID parameter.
    3. Click Execute.
    The response for each call contains the detailed information for that specific predecessor. Repeat this process for every dependency listed in the array to get the complete list of predecessors.