This commit is contained in:
2025-04-24 12:02:34 -07:00
parent 857cb3060a
commit b085961c31
3 changed files with 35 additions and 7 deletions

27
.local/bin/jira_export_todo Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
JIRA_URL="https://jira.atg-corp.com"
TOKEN="NDQ0ODE5ODQ5NDU0OkwyY36wdY9DAvXsBr1M4bMjFmp6"
QUERY='project = "IS" AND status in (Open, "In Progress", Blocked, "Waiting for Customer", Stalled) AND assignee in (currentUser())'
TODAY="$(date +%Y-%m-%d)"
TODO_FILE="$HOME/docs/todo/todo.txt"
TEMP_FILE="$(mktemp)"
# Encode JQL query
ENCODED_QUERY=$(printf '%s' "$QUERY" | jq -s -R -r @uri)
# Fetch JIRA issues (requires `curl` and `jq`)
curl -s -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$JIRA_URL/rest/api/2/search?jql=$ENCODED_QUERY" |
jq -r '.issues[] | [.key, .fields.summary, .self] | @tsv' > "$TEMP_FILE"
# Prevent duplicates and append new tasks
while IFS=$'\t' read -r key summary url; do
if ! grep -q "\[$key\]" "$TODO_FILE"; then
printf "(%s) [%s] %s @jira\n" "$TODAY" "$key" "$summary" >> "$TODO_FILE"
echo "Added [$key] $summary"
fi
done < "$TEMP_FILE"
rm -f "$TEMP_FILE"

View File

@@ -3,6 +3,9 @@
entry=$(gopass list --flat | bemenu -p Username: -l 25 -c -M 500 --fn 'Monospace 14' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00') entry=$(gopass list --flat | bemenu -p Username: -l 25 -c -M 500 --fn 'Monospace 14' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00')
if [ -n "$entry" ]; then if [ -n "$entry" ]; then
gopass show -c "$entry" username 2>/dev/null || notify-send "Gopass Error" "Failed to copy username from: $entry" if gopass show -c "$entry" username 2>/dev/null; then
notify-send "Gopass" "Username copied from: $entry"
else
notify-send "Gopass Error" "Failed to copy username from: $entry"
fi
fi fi

View File

@@ -1,9 +1,7 @@
#!/bin/sh #!/bin/sh
TODO_FILE="$HOME/docs/todo.txt" TODO_FILE="$HOME/docs/todo/todo.txt"
ARCHIVE_FILE="$HOME/docs/todo-archive.txt" ARCHIVE_FILE="$HOME/docs/todo/todo-archive.txt"
TODAY="$(date +%Y-%m-%d)" TODAY="$(date +%Y-%m-%d)"
case "$1" in case "$1" in
@@ -12,7 +10,7 @@ case "$1" in
echo "($TODAY) $*" >> "$TODO_FILE" echo "($TODAY) $*" >> "$TODO_FILE"
echo "Added: ($TODAY) $*" echo "Added: ($TODAY) $*"
;; ;;
lsa) la)
nl -w2 -s'. ' "$TODO_FILE" nl -w2 -s'. ' "$TODO_FILE"
;; ;;
ls) ls)