Child job with array values

Hi,

I'm using the generic extractor to get data from Zenhub API. This is the response for 'Get a ZenHub Board for a repository':

{
  "pipelines": [
    {
      "id": "595d430add03f01d32460080",
      "name": "New Issues",
      "issues": [
        {
          "issue_number": 279,
          "estimate": { "value": 40 },
          "position": 0,
          "is_epic": true
        },
        {
          "issue_number": 142,
          "is_epic": false
        }
      ]
    },
    {
      "id": "595d430add03f01d32460081",
      "name": "Backlog",
      "issues": [
        {
          "issue_number": 303,
          "estimate": { "value": 40 },
          "position": 3,
          "is_epic": false
        }
      ]
    },
    {
      "id": "595d430add03f01d32460082",
      "name": "To Do",
      "issues": [
        {
          "issue_number": 380,
          "estimate": { "value": 1 },
          "position": 0,
          "is_epic": true
        },
        {
          "issue_number": 284,
          "position": 2,
          "is_epic": false
        },
        {
          "issue_number": 329,
          "estimate": { "value": 8 },
          "position": 7,
          "is_epic": false
        }
      ]
    }
  ]
}

Basically, I need to run a child job where the placeholder is taken from an array inside of another array. Specifically, I need to run a child job which that uses the 'issue_number' from the 'issues' array as a placeholder, but I cannot get it to work. It seems similar to the Basic job with array value from the docs, but the value in the array is an object.

The following job works for one of the pipelines from the response, but I cannot get it to work for all of them.

{
    "endpoint": "/p2/workspaces/{1:workspace}/repositories/{1:repoid}/board",
    "dataType": "board",
    "dataField": "pipelines.0.issues",
    "placeholders": {
    "1:repoid": "repoid",
    "1:workspace": "id"
    },
    "children": [
    {
        "endpoint": "/p1/repositories/{2:repoid}/issues/{1:issue_number}/events",
        "dataType": "issuesEvents",
        "dataField": ".",
        "placeholders": {
        "2:repoid": "repoid",
        "1:issue_number": "issues.issue_number"
        }
    }
    ]
}

Any ideas on how to make it work?

2 replies