1
0
Fork 0

openproject_hours: add script

This commit is contained in:
Luca Bilke 2024-10-16 19:39:51 +02:00
commit e3ee13f563

View file

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