-
Notifications
You must be signed in to change notification settings - Fork 0
/
jira_data_pull.py
66 lines (49 loc) · 1.93 KB
/
jira_data_pull.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
# -*- 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'\\path\to\save\loc'
# perform auth to activate connection to api
japi = iJira(r'.\path\to\cert')
# issues report
japi.export_issues_report(f_path=save_loc)
# change history report
japi.export_change_history_report(f_path=save_loc)
# 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
japi.export_time_in_status_report(f_path=save_loc)