nephila / python-taiga

:evergreen_tree: Python module for communicating with the Taiga API
https://python-taiga.readthedocs.io
MIT License
94 stars 41 forks source link

Add Connection of User Stories with Swimlanes and/or Epics #177

Open Seriousness opened 4 months ago

Seriousness commented 4 months ago

I am by no means a python pro and am currently writing a small script to transfer a few thousand of Nexcloud Deck entries to Taiga. I have already accomplished most things yet the python-taiga wrapper does not seem to have a way to connect UserStories to Swimlanes or Epics, does it? It would be nice if thats possible.

edit: it seems following solves my problem. though "related userstories" might also be relevant for others

add_user_story(
        card["title"],
        description=card["description"],
        tags= [ label["title"] for label in card["labels"] ],
        due_date=card['duedate'],
        swimlane=swimlane.id
    )

# link epic to userstory
url = f"{host}/api/v1/epics/{epic.id}/related_userstories"
headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api.token}"
    }

data = {
        "epic": epic.id,
        "user_story": user_story.id
}

response = requests.post(url, headers=headers, json=data)