From e3ee13f5635922de933e2623c67dff18b557ca61 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 16 Oct 2024 19:39:51 +0200 Subject: [PATCH] openproject_hours: add script --- common/.local/bin/openproject_hours | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/.local/bin/openproject_hours b/common/.local/bin/openproject_hours index 53d8b6943..4abde03a5 100755 --- a/common/.local/bin/openproject_hours +++ b/common/.local/bin/openproject_hours @@ -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 ");