From 3374a3981538c0615ebfe36fc55a408f18d2bd17 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 10 Jul 2026 15:33:14 -0400 Subject: update jira-* scripts a little --- .local/bin/jira-ticketstatus.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to '.local/bin/jira-ticketstatus.php') diff --git a/.local/bin/jira-ticketstatus.php b/.local/bin/jira-ticketstatus.php index 2a50751..04a26de 100755 --- a/.local/bin/jira-ticketstatus.php +++ b/.local/bin/jira-ticketstatus.php @@ -4,7 +4,7 @@ if (empty(trim($argv[1]))) { echo "Please paste the tickets as an argument"; exit(3); } -$tickets = array_unique(array_filter(explode(' ', strtr($argv[1], "\n\t\"", ' ')))); +$tickets = array_unique(array_filter(explode(' ', strtr($argv[1], "\n\t\"/", ' ')))); function rgb(int $r, int $g, int $b): string { $blacktext = "\033[38;2;0;0;0m"; @@ -21,19 +21,23 @@ function status_to_ansi(string $status): string { $ansireset = "\033[0m"; $ansibrightblue = "\033[94m"; // purple return match($status) { - "Blocked" => rgb(252, 229, 205), //$ansiyellow, #fce5cd + "Blocked" => rgb(240, 226, 209), //rgb(252, 229, 205), //$ansiyellow, #fce5cd "Ready To Work" => $ansireset, - "In Progress" => rgb(230, 184, 175), //$ansired, #e6b8af - "Code Review" => rgb(234, 209, 220), //$ansimagenta, #ead1dc + "In Progress" => rgb(233, 175, 165), //rgb(230, 184, 175), //$ansired, #e6b8af + "Code Review" => rgb(228, 129, 188), //rgb(234, 209, 220), //$ansimagenta, #ead1dc "Pending Demo", - "Ready To Test", "Testing" => rgb(217, 210, 233), //$ansibrightblue, #d9d2e9 + "Ready To Test", "Testing" => rgb(131, 90, 226), //rgb(217, 210, 233), //$ansibrightblue, #d9d2e9 "Pending Sign Off", "Signed Off", "Ready To Deploy", - "Obsolete", "Done" => rgb(207, 226, 243), // $ansiblue, #cfe2f3 + "Obsolete", "Done" => rgb(32, 143, 223), //rgb(207, 226, 243), // $ansiblue, #cfe2f3 default => $ansireset, }; } +function linkify(string $key): string { + return str_replace("LAMP-", "", $key); +} + //echo implode(' ', $tickets); //exit(1); $keys = implode(',', array_filter($tickets, fn($x) => str_starts_with($x, 'LAMP-'))); @@ -46,12 +50,21 @@ foreach ($jira_tickets as $jira_ticket) { [$key, $status] = explode("\t", $jira_ticket); $ticket_status[$key] = $status; $search[] = $key; - $replace[] = status_to_ansi($status) . $key . "\033[0m"; + $replace[] = status_to_ansi($status) . linkify($key); // $search_replace[$key] = } + +$search[] = "HOLIDAY"; +$replace[] = "\033[0m" . "HOLIDAY"; + +$search[] = "PTO"; +$replace[] = "\033[0m" . "PTO"; + +$search[] = " / "; +$replace[] = "\033[0m" . "/"; echo "\n"; echo str_replace($search, $replace, $argv[1]); -echo "\n"; +echo "\033[0m" . "\n"; return; -- cgit 1.4.1