Closed psybers closed 6 months ago
Ok they definitely implement it via the REST API, it just is not documented. But I can see calls going to things like https://api.taiga.io/api/v1/swimlanes
.
Creating a swimlane sends this payload to that URL: {project: 1234, name: "test"}
Getting the swimlanes for a project: GET https://api.taiga.io/api/v1/swimlanes?project=1234
Editing: PATCH https://api.taiga.io/api/v1/swimlanes/12345
with a payload of the new name {name: "test"}
Deleting: DELETE https://api.taiga.io/api/v1/swimlanes/12346?moveTo=12345
. This one seems to pass an argument of another swimlane ID that the stories in the deleted lane should move to. Not sure what happens if you omit that.
Reordering: POST https://api.taiga.io/api/v1/swimlanes/bulk_update_order
with a payload {project: 1234, bulk_swimlanes: [[12347, 0], [12346, 1], [12345, 2], [12348, 3], [912345, 4]]}
I started working on this. Haven't had time to read contributing docs or write tests, but seems to work.
https://github.com/psybers/python-taiga/commit/416d35b382dfc3026bad371cb1c854f9388afb08
If I get time I might polish it up and PR. Feel free to use that code if you want to add it yourselves.
Description
Currently, the API has the ability to read data about swimlanes:
But the objects returned have no models. There also isn't, as far as I can find, a way to create or modify swimlanes.
Use cases
In general, it can be nice to add new swimlanes programmatically or to update existing ones. Changing their order might be especially useful.
My specific use case is because (apparently) duplicating a project does not duplicate its swimlanes. So I need a way to programmatically create a bunch of swimlanes for new projects.
Proposed solution
Adding
Swimlane
andSwimlanes
models, similar to the other models, and similar functions for creating/editing them.Projects would return these instances instead of the raw objects you get currently when you access
project.swimlanes
.You could also get a
Swimlane
object back from aUserStory
when callingus.swimlane
on it.Additional information
To be honest, the REST API documentation does not mention swimlanes anywhere. So it might not be supported on their end.