diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..74da93c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.venv/ +.env +*.crt \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/main.py b/main.py old mode 100644 new mode 100755 index 34c4c63..21e8182 --- a/main.py +++ b/main.py @@ -19,11 +19,16 @@ JIRA_URL = 'https://globaljira.roche.com/rest/api/2/issue/picker' USERNAME = os.getenv("JIRA_USER") PASSWORD = os.getenv("JIRA_PASSWORD") ROOT_CERT = ".\\Roche G3 Root CA.crt" +PRINT_RESPONSE_ON_ERR = False headers = { 'Content-Type': 'application/json' } +# For this query for user kalinom6 there are 6 results, 5 of them are correct, +# but one is certainly not associated with the user in any way according to +# the web application. The result set is lacking too, there should be way +# more issues assigned to this user query = { 'query': f'assignee = {USERNAME} AND status not in (Closed, Done)' } @@ -47,4 +52,8 @@ if response.status_code == 200: print(issues) else: print(f"Failed to execute JQL query. Status code: {response.status_code}") - print("Response:", response.text) \ No newline at end of file + if response.status_code == 403: + print("If you're sure you've set up the environment variables correctly\n \ + Please login to Jira in the browser to solve a CAPTCHA.") + if PRINT_RESPONSE_ON_ERR: + print("Response:", response.text) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt old mode 100644 new mode 100755