Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. import jira.client
  2. from jira.client import JIRA
  3. from jira import JIRA
  4. import pandas as pd
  5.  
  6. options = {'server':'your server URL here'}
  7. jira = JIRA(options, basic_auth=('your user name here','your password here'))
  8.  
  9.  
  10. #extracting number of issues loop because of Jira limitation.
  11. block_size=100
  12. block_num=0
  13. allissues = []
  14. while True:
  15. start_idx = block_num*block_size
  16. issues = jira.search_issues('project=your project here', start_idx, block_size)
  17. if len(issues) == 0:
  18. break
  19. block_num += 1
  20. for issue in issues:
  21. allissues.append(issue)
  22. print ('Number of issues:', len(allissues))
  23.  
  24. #into pandas
  25. issues=pd.DataFrame()
  26. for issue in allissues:
  27. d = {
  28.  
  29. 'assignee': issue.fields.assignee,
  30. 'key': issue.key,
  31. 'creator' : issue.fields.creator,
  32. 'reporter': issue.fields.reporter,
  33. 'created' : issue.fields.created,
  34. 'components': issue.fields.components,
  35. 'description': issue.fields.description,
  36. 'summary': issue.fields.summary,
  37. 'fixVersions': issue.fields.fixVersions,
  38. 'subtask': issue.fields.issuetype.subtask,
  39. 'issuetype': issue.fields.issuetype.name,
  40. 'priority': issue.fields.priority.name,
  41. 'resolution': issue.fields.resolution,
  42. 'resolution.date': issue.fields.resolutiondate,
  43. 'status.name': issue.fields.status.name,
  44. 'status.description': issue.fields.status.description,
  45. 'updated': issue.fields.updated,
  46. 'versions': issue.fields.versions,
  47. 'watches': issue.fields.watches.watchCount,
  48.  
  49. }
  50. issues = issues.append(d, ignore_index=True)
  51. issues.to_csv(r'your csv path here')
  52.  
  53. print(issues)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement