-
-
Save yv84/e87e43aefbf71b5db2311b3a412cec41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rest/api/2/search?jql=assignee="Юдинцев Владимир"&fields=*none | |
| rest/api/2/search?jql=status was "Resolved" by currentUser()&fields=*none | |
| /rest/api/2/search?jql=status was resolved by "Vyudintsev"&fields=*none | |
| /rest/api/2/search?jql=status changed to "REVIEW" by "VYudintsev"&fields=*none | |
| /rest/api/2/search?jql=status changed to "In Progress" by "VYudintsev"&fields=*none | |
| /rest/api/2/search?jql=fixVersion="XXX" AND assignee="Юдинцев Владимир"&fields=*none | |
| /rest/api/2/search?jql=status changed to "REVIEW" by "VYudintsev" AND project = XXX &fields=*none | |
| /rest/api/2/search?jql=filter = "My XYZ" AND filter = "My" OR filter = "My TTT" | |
| text ~ "123" | |
| # python | |
| login = "" | |
| password = "" | |
| domain_url = 'https://jira.example.com/' | |
| import requests, json | |
| from jinja2 import Template | |
| from requests.auth import HTTPBasicAuth | |
| jql_query_prefix = "rest/api/2/search?jql=" | |
| get_jql = lambda jql_query : requests.get(domain_url + jql_query_prefix + jql_query, auth=HTTPBasicAuth(login, password)) | |
| jql_query_t = Template('''{% if fixVersion %} fixVersion = {{fixVersion}} {% endif %} ''' +\ | |
| '''AND ((status CHANGED FROM "In Progress" TO "Resolved" {% if user %} BY "{{user}}" {% endif %}) ''' +\ | |
| ''' OR (status CHANGED FROM "In Progress" TO "REVIEW" {% if user %} BY "{{user}}" {% endif %})) ''' +\ | |
| ''' {% if project %} AND project = {{project}} {% endif %} ''' +\ | |
| '''AND status was "In Progress" ''' +\ | |
| '''&fields=*none"''') | |
| def get_fix_version_result(fixVersion, project): | |
| jql_query = jql_query_t.render(user='vyudintsev', fixVersion=fixVersion, project=project) | |
| response = get_jql(jql_query) | |
| mine_total = response.json()['total'] | |
| jql_query = jql_query_t.render(user=None, fixVersion=fixVersion, project=project) | |
| response = get_jql(jql_query) | |
| all_total = response.json()['total'] | |
| print("fixVersion={}, score={:.1f}, mine={}, total={}".format(fixVersion, 100. * mine_total/all_total, mine_total, all_total)) | |
| for fixVersion in ('1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1.10', '1.11', '1.12', '1.13', '1.14', '1.15', '1.16'): | |
| get_fix_version_result(fixVersion, 'XXX') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment