1
0

taiga_sync_fixes.py 1.4 KB

123456789101112131415161718192021222324252627
  1. import requests, urllib3
  2. urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  3. base_url = 'https://192.168.130.161/taiga/api/v1'
  4. auth = requests.post(f'{base_url}/auth', json={'type': 'normal', 'username': 'FrancoisLange', 'password': 'BTSai123'}, verify=False).json()
  5. headers = {'Authorization': f'Bearer {auth["auth_token"]}', 'Content-Type': 'application/json'}
  6. proj_id = 21
  7. # Fetch sprint 8
  8. milestones = requests.get(f'{base_url}/milestones?project={proj_id}', headers=headers, verify=False).json()
  9. sprint8 = next((m for m in milestones if m['name'] == 'Sprint 8'), None)
  10. sprint_id = sprint8['id'] if sprint8 else None
  11. if sprint_id:
  12. payload = {
  13. "project": proj_id,
  14. "subject": "Sprint 8 Final Bug Fixes & Polish",
  15. "description": "Implemented dynamic Help Sections in UI, upgraded LLM to Llama3 with strict anti-hallucination prompts, dynamic Pandas Styler limit caps, MyPlate bug fixes, and null-macro product filters.",
  16. "milestone": sprint_id
  17. }
  18. res = requests.post(f'{base_url}/userstories', json=payload, headers=headers, verify=False)
  19. if res.status_code == 201:
  20. us = res.json()
  21. print(f"Created Fixes US: {us['subject']}")
  22. t_payload = {"project": proj_id, "subject": "Execute Bug Fixes", "user_story": us['id'], "milestone": sprint_id}
  23. requests.post(f'{base_url}/tasks', json=t_payload, headers=headers, verify=False)
  24. else:
  25. print(f"Failed US: {res.text}")