Skip to content

Commit a23048a

Browse files
1) Def with list of Issue Types added to Jira.py (#644)
2)Script with counter of all issues for every issue type in jira and percentage of them in certain category
1 parent 0dd1900 commit a23048a

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

atlassian/jira.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,12 @@ def get_project_permission_scheme(self, project_id_or_key, expand=None):
17641764
params["expand"] = expand
17651765
return self.get(url, params=params)
17661766

1767+
def issue_types(self):
1768+
"""
1769+
Return all issue types
1770+
"""
1771+
return self.get('rest/api/2/issuetype')
1772+
17671773
def create_issue_type(self, name, description="", type="standard"):
17681774
"""
17691775
Create a new issue type
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from atlassian import Jira
2+
3+
jira = Jira(
4+
url='http://localhost:8080', username='admin', password='admin')
5+
6+
issue_types = jira.issue_types()
7+
print("Enter projects category:")
8+
category = input()
9+
10+
for i in issue_types:
11+
12+
issue_type = i['name']
13+
jql_all = 'issuetype = "{0}"'.format(issue_type)
14+
number = jira.jql(jql_all)['total']
15+
jql_of_category = 'issuetype = "{0}" AND category = {1}'.format(issue_type, category)
16+
number_of_deprecated = jira.jql(jql_of_category)['total']
17+
if number > 0:
18+
percent_of_deprecated = number_of_deprecated / number * 100
19+
else:
20+
percent_of_deprecated = 0
21+
percentage = round(percent_of_deprecated, 1)
22+
print('{0}, {1}, {2}% of {3}'.format(issue_type, number, percentage, category))

0 commit comments

Comments
 (0)