[This article is from the Sky Cloud-owned blog Park]
With the Jira class in Python we can easily manipulate the Jira to get some information we want to process.
Here is an example of an HTML page showing a list of tasks (unfinished, in-progress) assigned to everyone in the group.
The first step is to install the Jira Python library:
Install Jira
The second step is to get the task (unfinished, in-progress) of everyone in the group and write it to the local HTML file with the following code:
#-*-coding:utf-8-*- fromJiraImportJIRA#Login JiradefLogin_jira (Username,password): Jira= JIRA ("http://jira.ms.netease.com", basic_auth=(Username,password))returnJiradefgenerate_tasks_distribution (jira,testers): With open ("distribution.html","W") as F:f.write ("") F.write ("<link rel=\ "stylesheet\" href=\ "https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css\" >") F.write ("<script src=\ "https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js\" ></script>") F.write ("<script src=\ "Https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js\" ></script>") forTesterinchTESTERS:JQL='Test person ='+tester+'and status not in (resolved, Closed, do) ORDER by priority Desc, created desc'issues_in_progress=jira.search_issues (JQL) Count=Len (issues_in_progress) F.write ("<br/>") F.write ("<table class=\ "Table Table-hover\" >") F.write ("<caption style= ' text-align:center; ' >"+testers[tester]+""+STR (count) +"a </caption>") F.write ("<thead><tr><th> ordinal </th><th> title </th><th> creation Time </th></tr> </thead><tbody>") I=0 forIssueinchIssues_in_progress:key=issue.key URL="http://jiraUrl/"+Key Summary=Issue.fields.summary created= (issue.fields.created). Split ("T") [0] content="<tr><td>"+str (i+1) +"</td><td>"content+="<a href= '"+url+"' target= ' _blank ' >"+summary+"</a>"+"</td>"content+="<td><font color= ' red ' > Creation time:"+created+"</font></td></tr>"f.write (content) I+ = 1F.write ("</tbody></table>") F.write ("</body>")if __name__=='__main__': Username="User name"Password="Password"Testers= {"username1":"name of member 1","username2":"Name of member 2","Username3":"Name of member 3","Username4":"Name of member 4","Username5":"Name of member 5"} Jira=Login_jira (Username,password) generate_tasks_distribution (jira,testers)
After running, a distribution.html file is generated in the current directory, which is presented in a bootstrap table.
Open the HTML file in the browser to see the display effect, will be listed in the group of each member is currently in progress of the task list, including the sequence number, title (Click to jump to the corresponding Jira), the creation date.
The parts of the code that need to be replaced are:
Jiraurl: The portion of the URL that is replaced by the Jira of the corresponding company that does not contain Jira key;
Username: Replace the account user name with the login company Jira;
Password: Replace the account password of the login company Jira;
Testers: Which corresponds to the team member, the key value is written in Jira, the name of the member, value is written by the group's corresponding real name.
JIRA Python article show multiplayer unfinished task List