#!/usr/bin/env python3 # # automatic displaying of what is assigned to fixversion # for current and next release from jira import JIRA jira = JIRA('https://armbian.atlassian.net') from datetime import datetime month = datetime.now().strftime('%m') year = datetime.now().year def icons(arg): if str(arg) == "Bug": return ("Bug") if str(arg) == "Task": return ("Task") if str(arg) == "Story": return ("Story") if str(arg) == "Epic": return ("Epic''") if ( month <= "12" ): current_year=year+1 current_month="02" next_month="05" next_year=year+1 if ( month <= "11" ): current_year=year current_month="11" next_month="02" next_year=year+1 if ( month <= "08" ): current_year=year current_month="08" next_month="11" next_year=year if ( month <= "05" ): current_year=year current_month="05" next_month="08" next_year=year if ( month <= "02" ): current_year=year current_month="02" next_month="05" next_year=year # current f = open("jira-current.html", "w") current=str(current_year)[2:]+"."+current_month f.write('
\n

Should be completed in '+current+'

Sorted by priority

\n

\n') f.write('
\n
Check if you can review code that already waits at Pull reqests
\n
\n') f.write('
\n') for issue in jira.search_issues('project=AR and fixVersion="'+current+'" and status!="Done" and status!="Closed" order by Priority', maxResults=100): f.write('\n{} {}: {}, Assigned to: {}'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee )) f.write('\n
\n'); f.close() # next f = open("jira-next.html", "w") next=str(next_year)[2:]+"."+next_month f.write('\n
\n

Planned for '+next+' and further

Sorted by priority

\n
') for issue in jira.search_issues('project=AR and fixVersion="'+next+'" and status!="Done" and status!="Closed" order by priority desc', maxResults=100): f.write('\n{} {}: {}, Assigned to: {}'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee)) f.write('\n
\n'); f.close()