Greetings! I made automation (python +jira) , where I get a report that collects: "Top 5 projects from which most tickets are escalated to my project" and the report "Top 5 projects to which we escalate tickets most of all" But I have a little problem :- Instead of 806 issues, I have only 36 issues being processed (only the first jira page with tickets) Please help find the answer. Any help is appreciated! Thank you.
#coding=utf8
import os
import csv
from functionstelegram import get_jira
import smtplib
from itertools import zip_longest
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
from email.mime.application import MIMEApplication
# import datetime
# from xlsxwriter.workbook import Workbook
from collections import Counter
jira = get_jira()
results = jira.search_issues('project = "MRCHNT" AND issueLinkType in (clone,"cloned by") AND created >= startOfDay()')
list_owi_issues_key = []
list_iwi_issues_key = []
for issueId in results:
issue = jira.issue(issueId)
print(issue)
for link in issue.fields.issuelinks:
if hasattr(link, "outwardIssue"):
outwardIssue = link.outwardIssue
list_owi_issues_key.append(outwardIssue.key)
print("\tOutward: " + outwardIssue.key)
if hasattr(link, "inwardIssue"):
inwardIssue = link.inwardIssue
list_iwi_issues_key.append(inwardIssue.key)
print("\tInward: " + inwardIssue.key)
#print(list_owi_issues_key)
#print(list_iwi_issues_key)
list_modify_owi = []
list_count_issue_owi = []
for loik in list_owi_issues_key:
modify_loik = loik.split('-')
modify_loik_2 = (''.join(modify_loik[0]))
list_modify_owi.append(modify_loik_2)
print("\nList issues outward : {}".format((list_owi_issues_key)))
project_list_unique = list(set(list_modify_owi))
print("\nUnique Project outward : {}\n".format((project_list_unique)))
for pj in project_list_unique:
count_issue_owi_project = list_modify_owi.count(pj)
list_count_issue_owi.append(count_issue_owi_project)
test = dict(zip(project_list_unique, list_count_issue_owi))
# print(test)
c = Counter(test)
# [('four', 4), ('three', 3), ('two', 2), ('one', 1)]
top_pj = c.most_common()
print(top_pj)
print(top_pj[0])
print(top_pj[0][0])
print(top_pj[0][1])
print(top_pj[1])
print(top_pj[1][0])
print(top_pj[1][1])
print(top_pj[2])
print(top_pj[2][0])
print(top_pj[2][1])
print(top_pj[3])
print(top_pj[3][0])
print(top_pj[3][1])
print(top_pj[4])
print(top_pj[4][0])
print(top_pj[4][1])
############################################################# INWARD
list_modify_iwi = []
list_count_issue_iwi = []
for liik in list_iwi_issues_key:
modify_liik = liik.split('-')
modify_liik_2 = (''.join(modify_liik[0]))
list_modify_iwi.append(modify_liik_2)
print("\nList issues inward : {}".format((list_iwi_issues_key)))
project_iwi_list_unique = list(set(list_modify_iwi))
print("\nUnique Project inward : {}\n".format((project_iwi_list_unique)))
for pj_iwi in project_iwi_list_unique:
count_issue_iwi_project = list_modify_iwi.count(pj_iwi)
list_count_issue_iwi.append(count_issue_iwi_project)
test_iwi = dict(zip(project_iwi_list_unique, list_count_issue_iwi))
# print(test)
c = Counter(test_iwi)
# [('four', 4), ('three', 3), ('two', 2), ('one', 1)]
top_pj_iwi = c.most_common()
print(top_pj_iwi)
print(top_pj_iwi[0])
print(top_pj_iwi[0][0])
print(top_pj_iwi[0][1])
print(top_pj_iwi[1])
print(top_pj_iwi[1][0])
print(top_pj_iwi[1][1])
print(top_pj_iwi[2])
print(top_pj_iwi[2][0])
print(top_pj_iwi[2][1])
print(top_pj_iwi[3])
print(top_pj_iwi[3][0])
print(top_pj_iwi[3][1])
print(top_pj_iwi[4])
print(top_pj_iwi[4][0])
print(top_pj_iwi[4][1])
Where are you not getting the output you expect?
Where in your code do you have debug code to validate throughout that you have the data you expect and various points?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.