Skip to content

Issues retrieved with search_issues() has no .fields.comment #914

Open
@egeland

Description

@egeland

Describe the bug
If you retrieve a list of issues with JIRA.search_issues(), no comments are associated with the individual Issues in the list. You need to then use use JIRA.issue(id=<issue key>) to get a full Issue with comments.
It seems like "everything else" is included in the search results version of the Issue, so this feels like a bug.

To Reproduce
Steps to reproduce the behaviour:

api = JIRA(server=os.environ["JIRA_SERVER"], basic_auth=(os.environ["JIRA_USER"], os.environ["JIRA_PASS"]))
incomplete_issue = api.search_issues('project = "TEST" AND summary ~ "example"', maxResults=1)[0]

# The incomplete_issue has no comment field:
print(incomplete_issue.fields.comment)
# AttributeError: type object 'PropertyHolder' has no attribute 'comment'

# The full issue does have it:
full_issue = api.issue(id=incomplete_issue.key)
print(full_issue.fields.comment)
# <class 'jira.resources.PropertyHolder'>

Expected behaviour
The Issue retrieved with a search_issues() should be the whole Issue, not require another trip to the server.
or
The documentation should be very clear and explicit about this, which it is not at present time.

Version Information
Python Interpreter: 3.8.2
jira-python: 2.0.0
OS: Alpine Linux 3.10.4
IPython (Optional): 7.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions