Forums

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

Transitioning the issue to another swimlane via API call

Chua Sheng Yang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 17, 2021

This question is pertaining to https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post

I am having a problem with the POST request to transition an issue to another swimlane, it does not always work - sometimes it passes (204) and at other times, it fails (400 bad request).

My code is as such:

const config = {
headers: {
Authorization: `Basic ${token}`,
Accept: 'application/json'
}
};

const payload = {
transition: {
id: transitionId
}
};

let path = 'rest/api/3/issue/:issueNo/transitions';
path = path.replace(':issueNo', issueNo);
const url = domain + path;

axios.post(url, payload, config);

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2021

Welcome to the Community!

A clarification here - unless you have based your swimlanes on status (which is not something people do because it is not particularly useful), you do not use transitions to change the swimlane an issue is in.

I suspect you mean you are trying to move between columns.  Columns on a board are a collection of one or more status, and to change status of an issue, you need to use transitions.

If Jira is failing a transition for some reason, it should be replying to your post with a reason why - it could be that there is a condition blocking the transition, it is failing validation, or an internal error is occurring during the transition.  It should also tell you if a transition is not valid for the issue - this can give you a 400 error sometimes instead, depending on the reason, but the main ones would be a condition saying "no", or that you are trying to call a transition that is not valid for the current status of the issue.

I would want to check your workflow for all the reasons that might be blocking your transition (including there not actually being a transition there at all!)

Suggest an answer

Log in or Sign up to answer