-
Notifications
You must be signed in to change notification settings - Fork 0
/
jira_data_pull_test.py
71 lines (55 loc) · 2.42 KB
/
jira_data_pull_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
# Name: jira_data_pull.py
# Create by: Cody Hughes
# created date: 08/11/2021
# Description:
# This is a starting point for using the iJira interface. Currently this is more of a test area until a more formal
# and detailed solution is developed.
from iJira import iJira
import logging
import sys
#setup logger
def run():
""" Sets up logger app.
"""
# set up logger here then use throughout modules
format_str = '%(asctime)s - %(levelname)s - %(name)s - %(filename)s: %(lineno)s - %(message)s'
formatter = logging.Formatter(format_str)
file_handler = logging.FileHandler(filename=r'./logs/logfile.log',mode='w')
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter)
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setLevel(logging.INFO)
console_handler.setFormatter(formatter)
handlers = [file_handler,console_handler]
logging.basicConfig(level = logging.DEBUG,
handlers = handlers,
format = format_str)
logging.getLogger(__name__).info('Logger Setup and Ready')
if __name__ == '__main__':
run()
save_loc = r'\\fema.net\hqss\OPPASHARE\Enterprise Analytics Division\DashboardProjects\TableauDataSources\Jira_FRD'
#save_loc = r'\\hqli2f8\hqshare\Office of Policy and Program Analysis (OPPA)\Enterprise Analytics Division\DashboardProjects\TableauDataSources\Jira_FRD'
# perform auth to activate connection to api
japi = iJira(r'.\auth\oauth.pem')
# issues report
#print(japi.get_issues(limit=20,return_df=True))
japi.export_issues_report(f_path=save_loc)
# change history report
japi.export_change_history_report(f_path=save_loc)
#print(japi.get_histories(limit=2,return_df=True))
# components report
japi.export_components_report(f_path=save_loc)
# labels report
japi.export_label_report(f_path=save_loc)
# comments report
japi.export_comments_report(f_path=save_loc)
# linked issues / this might also be subtasks
japi.export_issue_links_report(f_path=save_loc)
# watchers report
japi.export_watchers_report(f_path=save_loc)
# time in status report
#print(japi.get_time_in_status(limit=20))
japi.export_time_in_status_report(f_path=save_loc)
# status issue count time series report
japi.export_issue_count_time_series_report(f_path=save_loc)