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 >> mysite.atlassion.com/rest/api/2/workflow
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
}
]
{"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