Create epics and their associated issues in one call

Hi,

I want to create multiple epics and for each of them a list of issues. I’ve found the /rest/api/3/issue/bulk call. The problem is that I can’t set the parent field because I don’t know the keys of the epics until they are generated. Is there a way to create and associated directly the issues to the newly created epics?

Thanks,
Bogdan

Hi @bogdan,

My understanding of the API is that you cannot retrieve the issue keys until they are created, that is correct. However, you can “predict” what keys will be created as they are always incremental from the last key number. So if your project ABC has issues up to ABC-10, you can predict the keys created will be ABC-11 up to however many you create (up to 50 per bulk call). The downside I can see here is that this would also not be a singular call as you would need to retrieve the existing keys anyway.

Cheers.

Gotcha. I have one more question. If I send three issues in a /rest/api/3/issue/bulk call, the response will be something like this:

{
  "issues": [
    {
      "id": "10000",
      "key": "ED-24",
      "self": "https://your-domain.atlassian.net/rest/api/3/issue/10000",
      "transition": {
        "status": 200,
        "errorCollection": {
          "errorMessages": [],
          "errors": {}
        }
      }
    },
    {
      "id": "10001",
      "key": "ED-25",
      "self": "https://your-domain.atlassian.net/rest/api/3/issue/10001"
    }
  ],
  "errors": []
}

Is it guaranteed that the first issue in the response is the first one from the request?

Hi @bogdan,

That rest API call is synchronous and will return issues in an ascending order by ID, that is correct and expected behavior.

Cheers