diff --git a/wh20/pendingcontracts/jiraupdater.py b/wh20/pendingcontracts/jiraupdater.py new file mode 100644 index 0000000..be38685 --- /dev/null +++ b/wh20/pendingcontracts/jiraupdater.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import csv +from datetime import datetime + +INPUT_CSV = "activation_overview.csv" + +ticket = input("Ticketnummer: ").strip() +order_no = input("Bestellnummer: ").strip() + +found = False + +with open(INPUT_CSV, newline="", encoding="utf-8") as f: + + reader = csv.DictReader(f) + + for row in reader: + + if row["order_no"] == order_no: + + timestamp = datetime.now().strftime("%Y-%m-%d %H:%M") + + print("\n--- JIRA Status ---\n") + print( + f"{timestamp} {ticket}\n\n" + f"{row['product']} für {row['domain']}" + ) + + found = True + break + +if not found: + print("Bestellung nicht gefunden.")