Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
133 lines
4.9 KiB
Python
133 lines
4.9 KiB
Python
"""
|
|
Sucht nach den drei kritischen Themen in Jira:
|
|
1. Implizite Annahme NAÄ (Netzausgeloeste Aenderungen)
|
|
2. 20h Zug
|
|
3. Abrechnung / AC Trasse / TTT
|
|
"""
|
|
import urllib.request, json, ssl
|
|
from pathlib import Path
|
|
|
|
secrets = {}
|
|
with open("project-audit/.secrets", "r", encoding="utf-8-sig") as f:
|
|
for line in f:
|
|
if "=" in line and not line.startswith("#"):
|
|
k, v = line.strip().split("=", 1)
|
|
secrets[k.strip()] = v.strip()
|
|
|
|
TOKEN = secrets.get("JIRA_TOKEN", "")
|
|
if not TOKEN:
|
|
print("FEHLER: JIRA_TOKEN nicht in .secrets!")
|
|
exit(1)
|
|
|
|
JIRA_URL = "https://arija.jaas.service.deutschebahn.com"
|
|
ctx = ssl.create_default_context()
|
|
ctx.check_hostname = False
|
|
ctx.verify_mode = ssl.CERT_NONE
|
|
|
|
def jira_search(jql, max_results=50):
|
|
url = f"{JIRA_URL}/rest/api/2/search?jql={urllib.parse.quote(jql)}&maxResults={max_results}&fields=key,summary,status,priority,assignee,created,updated,issuetype,labels"
|
|
req = urllib.request.Request(url)
|
|
req.add_header("Authorization", f"Bearer {TOKEN}")
|
|
req.add_header("Content-Type", "application/json")
|
|
try:
|
|
resp = urllib.request.urlopen(req, context=ctx, timeout=30)
|
|
return json.loads(resp.read().decode("utf-8"))
|
|
except Exception as e:
|
|
print(f" Fehler: {e}")
|
|
return None
|
|
|
|
import urllib.parse
|
|
|
|
print("=" * 80)
|
|
print("KRITISCHE THEMEN - Jira-Suche")
|
|
print("=" * 80)
|
|
|
|
# 1. Implizite Annahme / NAÄ
|
|
print("\n--- 1. Implizite Annahme / NAÄ / Netzausgelöste Änderungen ---")
|
|
queries_naa = [
|
|
'text ~ "implizite Annahme" ORDER BY updated DESC',
|
|
'text ~ "Netzausgelöste" ORDER BY updated DESC',
|
|
'text ~ "NAÄ" ORDER BY updated DESC',
|
|
'summary ~ "implizit" AND summary ~ "Annahme" ORDER BY updated DESC',
|
|
]
|
|
naa_issues = []
|
|
for jql in queries_naa:
|
|
result = jira_search(jql, 20)
|
|
if result and result.get("issues"):
|
|
for issue in result["issues"]:
|
|
key = issue["key"]
|
|
if key not in [i["key"] for i in naa_issues]:
|
|
naa_issues.append(issue)
|
|
|
|
print(f" Gefunden: {len(naa_issues)} Issues")
|
|
for issue in naa_issues[:15]:
|
|
fields = issue["fields"]
|
|
status = fields["status"]["name"]
|
|
prio = fields.get("priority", {}).get("name", "?")
|
|
assignee = fields.get("assignee", {})
|
|
assignee_name = assignee.get("displayName", "Unassigned") if assignee else "Unassigned"
|
|
print(f" {issue['key']:<15} [{status:<12}] {prio:<8} {fields['summary'][:60]}")
|
|
print(f" {'':15} Assignee: {assignee_name} Updated: {fields['updated'][:10]}")
|
|
|
|
# 2. 20h Zug / TTTSol
|
|
print("\n--- 2. 20h Zug ---")
|
|
queries_20h = [
|
|
'text ~ "20h Zug" ORDER BY updated DESC',
|
|
'text ~ "20-Stunden" ORDER BY updated DESC',
|
|
'project = TTTSol AND text ~ "20h" ORDER BY updated DESC',
|
|
'text ~ "20h" AND text ~ "Zug" ORDER BY updated DESC',
|
|
]
|
|
zug_issues = []
|
|
for jql in queries_20h:
|
|
result = jira_search(jql, 20)
|
|
if result and result.get("issues"):
|
|
for issue in result["issues"]:
|
|
key = issue["key"]
|
|
if key not in [i["key"] for i in zug_issues]:
|
|
zug_issues.append(issue)
|
|
|
|
print(f" Gefunden: {len(zug_issues)} Issues")
|
|
for issue in zug_issues[:15]:
|
|
fields = issue["fields"]
|
|
status = fields["status"]["name"]
|
|
prio = fields.get("priority", {}).get("name", "?")
|
|
assignee = fields.get("assignee", {})
|
|
assignee_name = assignee.get("displayName", "Unassigned") if assignee else "Unassigned"
|
|
print(f" {issue['key']:<15} [{status:<12}] {prio:<8} {fields['summary'][:60]}")
|
|
print(f" {'':15} Assignee: {assignee_name} Updated: {fields['updated'][:10]}")
|
|
|
|
# 3. Abrechnung / AC Trasse
|
|
print("\n--- 3. Abrechnung / AC Trasse ---")
|
|
queries_abr = [
|
|
'text ~ "Abrechnung" AND (project = TTTSol OR project = TTTI) AND status != Done ORDER BY priority DESC',
|
|
'text ~ "AC Trasse" ORDER BY updated DESC',
|
|
'summary ~ "Abrechnung" AND status != Done ORDER BY priority DESC',
|
|
]
|
|
abr_issues = []
|
|
for jql in queries_abr:
|
|
result = jira_search(jql, 30)
|
|
if result and result.get("issues"):
|
|
for issue in result["issues"]:
|
|
key = issue["key"]
|
|
if key not in [i["key"] for i in abr_issues]:
|
|
abr_issues.append(issue)
|
|
|
|
print(f" Gefunden: {len(abr_issues)} Issues")
|
|
for issue in abr_issues[:20]:
|
|
fields = issue["fields"]
|
|
status = fields["status"]["name"]
|
|
prio = fields.get("priority", {}).get("name", "?")
|
|
assignee = fields.get("assignee", {})
|
|
assignee_name = assignee.get("displayName", "Unassigned") if assignee else "Unassigned"
|
|
labels = ", ".join(fields.get("labels", []))
|
|
print(f" {issue['key']:<15} [{status:<12}] {prio:<8} {fields['summary'][:60]}")
|
|
if labels:
|
|
print(f" {'':15} Labels: {labels}")
|
|
|
|
print("\n" + "=" * 80)
|
|
print("ZUSAMMENFASSUNG")
|
|
print("=" * 80)
|
|
print(f" NAÄ/Implizite Annahme: {len(naa_issues)} Issues")
|
|
print(f" 20h Zug: {len(zug_issues)} Issues")
|
|
print(f" Abrechnung/AC Trasse: {len(abr_issues)} Issues")
|