How to create a swimlane in the Board programmatically using ReST API?
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
How to create a swimlane in the Board programmatically using REST API?
Solution
- First figure out the Board ID in which the Swimlane is to be created. One can make the GET getAllBoards API call to figure that out: <Jira_BASE_URL>/rest/agile/1.0/board/.
Refer screenshot below for reference: - Let's take the Board with ID 17 in the above screenshot and we will add a swimlane to this board.
- The next step is to make a POST call to the endpoint: <Jira_BASE_URL>/rest/greenhopper/1.0/swimlanes/<Board_ID>/. The user needs to replace the Board ID in this API call which we got from the above GET call. Make sure to set the Accept and Content Type headers to application/json.
In the above screenshot, we added the swimlane with the JQL query: issueType = bug. - Verify by going to the respective board if the swimlane is created and issues are grouped based on the swimlane.
Please note that the POST call to create the swimlanes is not documented in the Jira Agile Server REST API reference and thus users need to be cautious while working with it. Also, Atlassian may not be taking improvements or bug fix requests on this API for the same reason.