Skip to content

Commit 3c1d66a

Browse files
authored
[JIRA] Documentation and example addition for getting all projects (#816)
* Jira : Get All Project Issues example added Closes #815 * Get all Project Issues docstring added Closes #815 * black reformatting applied
1 parent 61d61d8 commit 3c1d66a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

atlassian/jira.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,14 @@ def get_project_issues_count(self, project):
20732073
return self.jql(jql, fields="*none")["total"]
20742074

20752075
def get_all_project_issues(self, project, fields="*all", start=0, limit=None):
2076+
"""
2077+
Get the Issues for a Project
2078+
:param project: Project Key name
2079+
:param fields: OPTIONAL list<str>: List of Issue Fields
2080+
:param start: OPTIONAL int: Starting index/offset from the list of target issues
2081+
:param limit: OPTIONAL int: Total number of project issues to be returned
2082+
:return: List of Dictionary for the Issue(s) returned.
2083+
"""
20762084
jql = "project = {project} ORDER BY key".format(project=project)
20772085
return self.jql(jql, fields=fields, start=start, limit=limit)["issues"]
20782086

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
"""
3+
Getting Project Issue(s) example
4+
"""
5+
6+
7+
from atlassian import Jira
8+
9+
10+
jira = Jira(url="https://jirasite.co", username="ocean", password="seariver")
11+
12+
13+
if __name__ == "__main__":
14+
# default will return 50 issues in ascending order
15+
project_issues_default_50 = jira.get_all_project_issues(project="APA")
16+
# We can increase the limit by specifying the limit
17+
project_issues_100 = jira.get_all_project_issues(project="APA", limit=100)
18+
# Specifying specific fields other than the default jira fields returned
19+
project_issues_specific = jira.get_all_project_issues(project="APA", fields=["description", "summary"], limit=100)

0 commit comments

Comments
 (0)