Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing description for user stories? #105

Closed
najarvis opened this issue Feb 5, 2021 · 4 comments · Fixed by #120
Closed

Missing description for user stories? #105

najarvis opened this issue Feb 5, 2021 · 4 comments · Fixed by #120

Comments

@najarvis
Copy link

najarvis commented Feb 5, 2021

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

@PeterAlabaster
Copy link

PeterAlabaster commented Apr 26, 2021

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
Copy link

PeterAlabaster commented May 15, 2021

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")

@najarvis
Copy link
Author

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.

@yakky
Copy link
Member

yakky commented Oct 23, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants