python-taiga icon indicating copy to clipboard operation
python-taiga copied to clipboard

Missing description for user stories?

Open najarvis opened this issue 4 years ago • 4 comments

Description

When creating a user story you have the option to specify a description, but when you get the UserStory that is created you can't access that variable. There is a "comment" field, I'm not sure if those are supposed to be the same

Steps to reproduce

  1. Create a user story following the steps here https://pypi.org/project/python-taiga/, make sure to add a description
  2. Access the newly created UserStory object and try to find the description you just added.

Versions

Python version 3.7.3

Expected behaviour

A 'description' variable that holds the description you just added. You can see it when you access Taiga in the browser, just not in code.

Actual behaviour

No description.

Additional information

The comment variable is empty too

najarvis avatar Feb 05 '21 23:02 najarvis

Just noticed this also seems to be the case with the Issue object too

api.issues.list()[0].description
AttributeError: 'Issue' object has no attribute 'description'

Source code looks like it does have handling for this though Am on Taiga 6.0.1

PeterAlabaster avatar Apr 26 '21 20:04 PeterAlabaster

This might not totally relate to the originally submitted issue, but:

It appears that taiga REST api does not return description on https://docs.taiga.io/api.html#issues-list or https://docs.taiga.io/api.html#user-stories-list so this technically isn't an issue with python-taiga, but the way the Issues, Userstory models in python-taiga are made can lead to the assumption that it should work when using issues.list() and user_stories.list()

The issue, and user-story individual getters do return this, but it leads to very slow performance. For instance, i can hack it in with

# Issues workaround
[issue.requester.get(f"/issues/{issue.id}").json().get("description") for issue in api.issues.list()]
# User stories workaround
[user_story.requester.get(f"/userstories/{user_story.id}").json().get("description") for user_story in api.user_stories.list()]

For my implementation, i'm just going to hold off grabbing the description until it is needed and use the individual id getter when it is needed, and when i request one, i just send id in the bugitem object:

description = api.issues.requester.get(
    f"/issues/{bugitem.id}"
).json().get("description")

PeterAlabaster avatar May 15 '21 12:05 PeterAlabaster

It appears that taiga REST api does not return description on https://docs.taiga.io/api.html#issues-list or https://docs.taiga.io/api.html#user-stories-list so this technically isn't an issue with python-taiga

Good find, according to this google group thread it isn't available in the "list" commands because the descriptions can be very long. It mentions a "detail" call but I'm not seeing a separate "detail" option in the python taiga API itself, so I think your solution of getting the raw JSON and pulling the description is the best we'll get.

najarvis avatar May 17 '21 19:05 najarvis

@najarvis @PeterAlabaster thanks for reporting this, it's actually a documentation issue, as the attribute is not available in the list response #120 fixes the documentation by clarifying the API behavior

yakky avatar Oct 23 '21 09:10 yakky