summary refs log tree commit diff
path: root/.local/bin/jira-ticketstatus.php
diff options
context:
space:
mode:
authorZach DeCook <zach.decook@bettercarpeople.com>2026-07-10 15:33:14 -0400
committerZach DeCook <zach.decook@bettercarpeople.com>2026-07-10 15:33:14 -0400
commit3374a3981538c0615ebfe36fc55a408f18d2bd17 (patch)
tree63c58432ed9c7d4808e85ba897a4ed1d4dc7f0f2 /.local/bin/jira-ticketstatus.php
parent0b980ed433dbc7262a6cf5d13689f1c67f3c98c4 (diff)
downloaddotfiles-3374a3981538c0615ebfe36fc55a408f18d2bd17.tar.gz
update jira-* scripts a little
Diffstat (limited to '.local/bin/jira-ticketstatus.php')
-rwxr-xr-x.local/bin/jira-ticketstatus.php29
1 files changed, 21 insertions, 8 deletions
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;