Jira "transition ... is not valid" (workflow transition id) in CI
Jira accepts a transition only if it exists in the workflow from the issue current status. Passing a transition id that is not offered from the present status, or a name where an id is required, returns a 400.
What this error means
A POST to /issue/KEY/transitions fails with 400 and "Transition id X is not valid for the current status of the issue," even though the transition exists elsewhere in the workflow.
HTTP/1.1 400 Bad Request
{"errorMessages":["It is not possible to change the status of this issue to the requested status."],
"errors":{}}Common causes
The transition is not available from the current status
Workflows expose different transitions per status. A transition valid from "To Do" may not exist from "In Progress," so its id is rejected.
A transition name was sent instead of its id
The transitions API keys on numeric ids, and ids differ per workflow. Hardcoding a name or the wrong number fails.
How to fix it
Look up the valid transitions for this issue first
- GET the available transitions for the specific issue and status.
- Read the numeric id whose
to.nameis your target status. - POST that id, which is guaranteed valid from the current status.
curl -sf -u "$JIRA_EMAIL:$JIRA_API_TOKEN" \
"https://your-domain.atlassian.net/rest/api/3/issue/ABC-123/transitions"Post the resolved transition id
Use the id discovered above rather than a hardcoded number, since ids vary across workflows and projects.
curl -sf -u "$JIRA_EMAIL:$JIRA_API_TOKEN" -X POST \
-H "Content-Type: application/json" \
-d '{"transition":{"id":"31"}}' \
"https://your-domain.atlassian.net/rest/api/3/issue/ABC-123/transitions"How to prevent it
- Resolve transition ids at runtime from the issue current status.
- Never hardcode transition ids across projects or workflows.
- Map target status names to ids dynamically per issue.