pycontribs / jira

Python Jira library. Development chat available on https://matrix.to/#/#pycontribs:matrix.org
https://jira.readthedocs.io
BSD 2-Clause "Simplified" License
1.95k stars 864 forks source link

Improve documentation/code accuracy regarding object structures #1797

Open Timelessprod opened 8 months ago

Timelessprod commented 8 months ago

Problem trying to solve

When building an app on top of the Jira library I am often lost about what fields are available for comments or other objects. The Python class type for such object does not have explicit attributes in the library code and the documentation doesn't show the fields either.

This example for comments can be extended to other classes and is very slowing down the development using this library. Overall the current implementation of the library uses a lot of abstract classes when a way simpler implementation could be possible and that makes the code less readable and doesn't allow IDEs to autocomplete code and provide insights.

Possible solution(s)

Adjust the documentation with a list of all fields existing for all type of objects (Comments, issues, users, ...) and/or adjust implementation of object representation

Alternatives

No response

Additional Context

For example, from the documentation and source code themselves, how am I supposed to know the fields names and structures of a Jira comment ? This is the type of question that may come back every time someone is working with Jira.

cybit commented 6 months ago

As someone who has been running in this problem as well: The problem is not this library but the rest interface (and the internal structure) of Jira.
The way each object needs to be handled and is connected in Jira differs. There is no clearly described structure (no not even for the most basic objects. ). Once you go into custom fields from external plugins it gets even worse.

The way I see it the implementation here does it's best to guess a way to fill in the gaps without either breaking all the time or not working as soon as Jira is being extended with some plugin from the marketplace.