Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

400 Error Trying to use API to create a Workflow Object

Deleted user February 15, 2023

I am getting a 400 error when trying to use the JIRA API

to create a workflow object i.a.w. the JIRA Cloud API specification:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflow-post

The HTTP POST body JSON is shown below and should be valid according to the documentation and example.

The API end point is `/rest/api/3/workflow`.


Any thoughts on why the server is rejecting it?


{
"name": "foo-workflow-name-278828446683910193",
"transitions": [
{
"name": "Created",
"to": "1",
"type": "initial",
"description": "Test Workflow Transition",
"from": []
},
{
"name": "In progress",
"to": "2",
"type": "directed",
"description": "Dummy transition desc.",
"from": [
"1"
],
"screen": {
"id": "10001"
}
},
{
"name": "Completed",
"to": "3",
"type": "global",
"from": []
}
],
"statuses": [
{
"id": "1",
"properties": {
"jira.issue.editable": "false"
}
},
{
"id": "2"
},
{
"id": "3"
}
],
"description": "A dull description for a workflow."
}

Furthermore, the error response from the server does not contain enough detail to resolve the issue and that's a problem per-se.

`{"errorMessages":["Invalid request payload. Refer to the REST API documentation and try again."]}`

1 answer

1 accepted

0 votes
Answer accepted
Deleted user February 17, 2023

This was an error in the serialization code, but I also discovered that the example values aren't valid, so there is actually an error in the JIRA API documentation.

 

Id "2" doesn't exist by default AFAICT in a "clean" JIRA cloud instance.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD Trial
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events