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

Extending get_items with root_only boolean #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions py_jama_rest_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,19 @@ def get_filter_results(self, filter_id, project_id=None, allowed_results_per_pag
filter_results = self.__get_all(resource_path, params=params, allowed_results_per_page=allowed_results_per_page)
return filter_results

def get_items(self, project_id, allowed_results_per_page=__allowed_results_per_page):
def get_items(self, project_id, root_only=False, allowed_results_per_page=__allowed_results_per_page):
"""
This method will return all items in the specified project.
Args:
project_id: the project ID
root_only: boolean to give only the root nodes
allowed_results_per_page: number of results per page

Returns: a Json array of item objects

"""
resource_path = 'items'
params = {'project': project_id}
params = {'project': project_id, 'rootOnly': True}
item_data = self.__get_all(resource_path, params=params, allowed_results_per_page=allowed_results_per_page)
return item_data

Expand Down