openproject_hours: add script
This commit is contained in:
parent
5d57242aff
commit
e3ee13f563
|
@ -4,10 +4,10 @@
|
|||
year=$1
|
||||
month=$2
|
||||
|
||||
USER_ID=12
|
||||
API_KEY=$(cat "${HOME}/.secrets/openproject_apikey")
|
||||
API_URL=https://op.tralios.de
|
||||
PAGE_SIZE=1000
|
||||
USER_ID="12"
|
||||
API_KEY="<#openproject_apikey#>"
|
||||
API_URL="https://op.tralios.de"
|
||||
PAGE_SIZE="1000"
|
||||
|
||||
filters='[
|
||||
{
|
||||
|
@ -25,12 +25,12 @@ filters='[
|
|||
]'
|
||||
|
||||
curl -s \
|
||||
-u "apikey:${API_KEY}" \
|
||||
-G "${API_URL}/api/v3/time_entries" \
|
||||
--data-urlencode "filters=${filters}" \
|
||||
--data-urlencode "pageSize=${PAGE_SIZE}" |
|
||||
jq -r '._embedded.elements | map(.hours) | join(" ")' |
|
||||
awk '{
|
||||
-u "apikey:${API_KEY}" \
|
||||
-G "${API_URL}/api/v3/time_entries" \
|
||||
--data-urlencode "filters=${filters}" \
|
||||
--data-urlencode "pageSize=${PAGE_SIZE}" |
|
||||
jq -r '._embedded.elements | map(.hours) | join(" ")' |
|
||||
awk '{
|
||||
gsub(/PT/, "");
|
||||
gsub(/H/, "H ");
|
||||
gsub(/M/, "M ");
|
||||
|
|
Loading…
Reference in New Issue