24 lines
677 B
Python
24 lines
677 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
import time
|
||
|
import json
|
||
|
import requests
|
||
|
import subprocess
|
||
|
|
||
|
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||
|
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
||
|
|
||
|
date = time.localtime()
|
||
|
if len(sys.argv) > 1:
|
||
|
date = subprocess.check_output(['date','-d',sys.argv[1],'+%s'])
|
||
|
date = float(date)
|
||
|
date = time.localtime(date)
|
||
|
|
||
|
date = time.strftime(r'%Y-%m-%d', date)
|
||
|
|
||
|
url_template = 'https://jira.bloopark.com/rest/tempo-timesheets/3/worklogs?projectKey=PAS&dateFrom={}&dateTo={}&expand=issue.status'
|
||
|
|
||
|
resp = requests.get(url_template.format(date, date), verify=False)
|
||
|
print(json.dumps(resp.json()))
|