|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# |
| 3 | +# automatic displaying of what is assigned to fixversion |
| 4 | +# for current and next release |
| 5 | + |
| 6 | +from jira import JIRA |
| 7 | +jira = JIRA('https://armbian.atlassian.net') |
| 8 | + |
| 9 | +from datetime import datetime |
| 10 | +month = datetime.now().strftime('%m') |
| 11 | +year = datetime.now().year |
| 12 | + |
| 13 | +def icons(arg): |
| 14 | + if str(arg) == "Bug": |
| 15 | + return ("<img alt='Bug' src=https://armbian.atlassian.net/images/icons/issuetypes/bug.svg width=24>") |
| 16 | + if str(arg) == "Task": |
| 17 | + return ("<img alt='Task' src=https://armbian.atlassian.net/images/icons/issuetypes/task.svg width=24>") |
| 18 | + if str(arg) == "Story": |
| 19 | + return ("<img alt='Story' src=https://armbian.atlassian.net/images/icons/issuetypes/story.svg width=24>") |
| 20 | + if str(arg) == "Epic": |
| 21 | + return ("<img alt=Epic'' src=https://armbian.atlassian.net/images/icons/issuetypes/epic.svg width=24>") |
| 22 | + |
| 23 | +if ( month <= "12" ): |
| 24 | + current_year=year+1 |
| 25 | + current_month="02" |
| 26 | + next_month="05" |
| 27 | + next_year=year+1 |
| 28 | + |
| 29 | +if ( month <= "11" ): |
| 30 | + current_year=year |
| 31 | + current_month="11" |
| 32 | + next_month="02" |
| 33 | + next_year=year+1 |
| 34 | + |
| 35 | +if ( month <= "08" ): |
| 36 | + current_year=year |
| 37 | + current_month="08" |
| 38 | + next_month="11" |
| 39 | + next_year=year |
| 40 | + |
| 41 | +if ( month <= "05" ): |
| 42 | + current_year=year |
| 43 | + current_month="05" |
| 44 | + next_month="08" |
| 45 | + next_year=year |
| 46 | + |
| 47 | +if ( month <= "02" ): |
| 48 | + current_year=year |
| 49 | + current_month="02" |
| 50 | + next_month="05" |
| 51 | + next_year=year |
| 52 | + |
| 53 | +# current |
| 54 | +f = open("jira-current.html", "w") |
| 55 | +current=str(current_year)[2:]+"."+current_month |
| 56 | +f.write('<div style="color: #ccc;">\n<h1 style="color: #ccc;">Should be completed in '+current+'</h1>Sorted by priority<p>\n</div>\n') |
| 57 | +f.write('<div style="color: #ccc;">\n<h5 style="color: #ccc;"><a href=https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aopen+label%3A%22Needs+review%22+and+label%3A%22'+current_month+'%22>Check if you can review code that already waits at Pull reqests</a></h5>\n</div>\n') |
| 58 | +f.write('<div class="icon-menu">\n') |
| 59 | +for issue in jira.search_issues('project=AR and fixVersion="'+current+'" and status!="Done" and status!="Closed" order by Priority', maxResults=100): |
| 60 | + f.write('\n<a class="icon-menu__link" href=https://armbian.atlassian.net/browse/{}>{} {}: {}, <i>Assigned to: {}</i></a>'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee )) |
| 61 | +f.write('\n</div>\n'); |
| 62 | +f.close() |
| 63 | + |
| 64 | +# next |
| 65 | +f = open("jira-next.html", "w") |
| 66 | +next=str(next_year)[2:]+"."+next_month |
| 67 | +f.write('\n<div style="color: #ccc;">\n<h1 style="color: #ccc;">Planned for '+next+' and further</h1>Sorted by priority<p></div>\n<div class="icon-menu">') |
| 68 | +for issue in jira.search_issues('project=AR and fixVersion="'+next+'" and status!="Done" and status!="Closed" order by priority desc', maxResults=100): |
| 69 | + f.write('\n<a class="icon-menu__link" href=https://armbian.atlassian.net/browse/{}>{} {}: {}, <i>Assigned to: {}</i></a>'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee)) |
| 70 | +f.write('\n</div>\n'); |
| 71 | +f.close() |
0 commit comments