1
0
Fork 0

openproject_hours: add script

This commit is contained in:
Luca Bilke 2024-10-16 19:39:51 +02:00
parent 5d57242aff
commit e3ee13f563
1 changed files with 10 additions and 10 deletions

View File

@ -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 ");