Ambiguous error trying to create new workflow with API

Hi,

Using Rest API v2, and my body looks exactly like what the endpoint is asking for, but a silly “Invalid request. Could not parse request body.” is not helping anyone figuring out what exactly the issues is.

Endpoint >> Loading...

Request header

Request name: Create Workflow,
  Request: 
{
    method: POST,
    content_type: application/json,
    url: https://mysite.atlassian.net/rest/api/2/workflow,
    headers: 
[
       
{
        value: Basic IWishAtlassianHadProperErrorCodesOrErrorMessages,
        header: Authorization
      }
    ]

API >> https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflow-post

{"name":"Testing Default Development Workflow","description":"Workflow for Testing","statuses":[{"id":"10129"},{"id":"10119"},{"id":"10121"},{"id":"10117"},{"id":"10128"},{"id":"10120"},{"id":"10118"},{"id":"10122"},{"id":"10124"},{"id":"10123"},{"id":"10127"},{"id":"10125"},{"id":"10126"}],"transitions":[{"name":"Open - Testing","to":"10117","type":"initial"},{"name":"Ready for Development","to":"10118","type":"global"},{"name":"Start Development","from":"10118","to":"10119","type":"directed"},{"name":"Send for Code Review","from":"10119","to":"10120","type":"directed"},{"name":"Start Code Review","from":"10120","to":"10121","type":"directed"},{"name":"Approve Code","description":"Approval of the code that's been reviewed will transition the issue to  SIT deployment queue.","from":"10121","to":"10122","type":"directed"},{"name":"Move to Test Queue","description":"Issue is ready to be tested.","from":["10119","10118","10122"],"to":"10123","type":"directed"},{"name":"Start Testing","description":"The issue is now going into testing and should be assigned to a QA engineer.","from":"10123","to":"10124","type":"directed"},{"name":"Move Back to Queue","from":"10124","to":"10123","type":"directed"},{"name":"Issue Needs Rework","from":["10129","10121","10128","10122","10124","10127"],"to":"10118","type":"directed"},{"name":"Back to Sprint Backlog","from":"10119","to":"10118","type":"directed"},{"name":"Re-open","from":["10129","10118"],"to":"10117","type":"directed"},{"name":"Pass Issue","description":"The issue has been fully tested and meets all acceptance criteria.  It will now be placed in the UAT Deployment Queue so that it can be deployed to the UAT environment.","from":"10124","to":"10125","type":"directed"},{"name":"Code Deployed to UAT","description":"Code has been deployed to the UAT environment and is now ready to go through User Acceptance Testing.\nIssue should be assigned to Product Owner for the business.","from":"10125","to":"10126","type":"directed"},{"name":"Start UAT","from":"10126","to":"10127","type":"directed"},{"name":"Return to UAT Queue","from":"10127","to":"10126","type":"directed"},{"name":"Pass UAT","description":"Issue passed UAT and is approved for Production Launch.","from":["10129","10127"],"to":"10128","type":"directed"},{"name":"Close Issue","description":"Once the issue has been launched to the Production (PROD) environment, then it can be closed out.","from":"10128","to":"10129","type":"directed"},{"name":"Cancel/Close Issue","description":"Close or Cancel the issue before it's gone through the normal workflow.","to":"10129","type":"global"}]}

JSON Validated output

{
  "name": "Testing Default Development Workflow",
  "description": "Workflow for Testing",
  "statuses": [
    {
      "id": "10129"
    },
    {
      "id": "10119"
    },
    {
      "id": "10121"
    },
    {
      "id": "10117"
    },
    {
      "id": "10128"
    },
    {
      "id": "10120"
    },
    {
      "id": "10118"
    },
    {
      "id": "10122"
    },
    {
      "id": "10124"
    },
    {
      "id": "10123"
    },
    {
      "id": "10127"
    },
    {
      "id": "10125"
    },
    {
      "id": "10126"
    }
  ],
  "transitions": [
    {
      "name": "Open - Testing",
      "to": "10117",
      "type": "initial"
    },
    {
      "name": "Ready for Development",
      "to": "10118",
      "type": "global"
    },
    {
      "name": "Start Development",
      "from": "10118",
      "to": "10119",
      "type": "directed"
    },
    {
      "name": "Send for Code Review",
      "from": "10119",
      "to": "10120",
      "type": "directed"
    },
    {
      "name": "Start Code Review",
      "from": "10120",
      "to": "10121",
      "type": "directed"
    },
    {
      "name": "Approve Code",
      "description": "Approval of the code that's been reviewed will transition the issue to  SIT deployment queue.",
      "from": "10121",
      "to": "10122",
      "type": "directed"
    },
    {
      "name": "Move to Test Queue",
      "description": "Issue is ready to be tested.",
      "from": [
        "10119",
        "10118",
        "10122"
      ],
      "to": "10123",
      "type": "directed"
    },
    {
      "name": "Start Testing",
      "description": "The issue is now going into testing and should be assigned to a QA engineer.",
      "from": "10123",
      "to": "10124",
      "type": "directed"
    },
    {
      "name": "Move Back to Queue",
      "from": "10124",
      "to": "10123",
      "type": "directed"
    },
    {
      "name": "Issue Needs Rework",
      "from": [
        "10129",
        "10121",
        "10128",
        "10122",
        "10124",
        "10127"
      ],
      "to": "10118",
      "type": "directed"
    },
    {
      "name": "Back to Sprint Backlog",
      "from": "10119",
      "to": "10118",
      "type": "directed"
    },
    {
      "name": "Re-open",
      "from": [
        "10129",
        "10118"
      ],
      "to": "10117",
      "type": "directed"
    },
    {
      "name": "Pass Issue",
      "description": "The issue has been fully tested and meets all acceptance criteria.  It will now be placed in the UAT Deployment Queue so that it can be deployed to the UAT environment.",
      "from": "10124",
      "to": "10125",
      "type": "directed"
    },
    {
      "name": "Code Deployed to UAT",
      "description": "Code has been deployed to the UAT environment and is now ready to go through User Acceptance Testing.\nIssue should be assigned to Product Owner for the business.",
      "from": "10125",
      "to": "10126",
      "type": "directed"
    },
    {
      "name": "Start UAT",
      "from": "10126",
      "to": "10127",
      "type": "directed"
    },
    {
      "name": "Return to UAT Queue",
      "from": "10127",
      "to": "10126",
      "type": "directed"
    },
    {
      "name": "Pass UAT",
      "description": "Issue passed UAT and is approved for Production Launch.",
      "from": [
        "10129",
        "10127"
      ],
      "to": "10128",
      "type": "directed"
    },
    {
      "name": "Close Issue",
      "description": "Once the issue has been launched to the Production (PROD) environment, then it can be closed out.",
      "from": "10128",
      "to": "10129",
      "type": "directed"
    },
    {
      "name": "Cancel/Close Issue",
      "description": "Close or Cancel the issue before it's gone through the normal workflow.",
      "to": "10129",
      "type": "global"
    }
  ]
}

This code has been checked by a JSON Validator, no errors according to validator.

Can someone please help me figure out why I cannot create this workflow??

  • Yes, I am full admin
  • Yes, authorization and all works as it takes billion steps to get to this point
  • Input type is JSON posted in the body
  • Yes all statuses are correct and added before
  • Yes all screens exist and is created before

Full Error Message

400 Bad Request
date: Fri, 24 Jun 2022 09:59:10 GMT
content_type: application/json;charset=UTF-8
server: globaledge-envoy
timing_allow_origin: *
x_arequestid: f6df553a-d607-426d-9d64-8af522fddb3c
set_cookie: ["atlassian.xsrf.token=d2924bfc-62a0-4f66-afe4-163fe9fda6cf_f512d9beae79e47ef79b45d61e4986d13bd64c5c_lin; path=/; SameSite=None; Secure"]
x_aaccountid: 620e4ed1f4d8af0070fe99d5
cache_control: no-cache, no-store, no-transform
x_envoy_upstream_service_time: 155
expect_ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/atlassian-proxy", max-age=86400
strict_transport_security: max-age=63072000; preload
x_content_type_options: nosniff
x_xss_protection: 1; mode=block
atl_traceid: d91affb77bc9fbad
report_to: {"group": "endpoint-1", "max_age": 600, "endpoints": [{"url": "https://dj9s4kmieytgz.cloudfront.net"}], "include_subdomains": true}
nel: {"report_to": "endpoint-1", "max_age": 600, "include_subdomains": true, "failure_fraction": 0.001}
transfer_encoding: chunked

{
  "errorMessages": [
    "Invalid request. Could not parse request body."
  ]
}