Update app.py
Browse files
app.py
CHANGED
|
@@ -74,39 +74,40 @@ async def create_task(request: Request):
|
|
| 74 |
print(f"Start Date: {start_date}")
|
| 75 |
print(f"End Date: {end_date}")
|
| 76 |
|
| 77 |
-
# Strategy task logic
|
| 78 |
-
if task_type.lower() == "content":
|
| 79 |
-
status = "to do"
|
| 80 |
-
print(f"Status: {status}")
|
| 81 |
-
|
| 82 |
-
web_app_url = "https://script.google.com/macros/s/AKfycby5hTb6dcWWJ6Q6vDm4mWHEnbOkLnM5rOFdyV7_nkh57-tZxSA7m4yPiHdEJsaR3XQR/exec"
|
| 83 |
-
params = {
|
| 84 |
-
"mode": "extended",
|
| 85 |
-
"taskType": task_type,
|
| 86 |
-
"company": team,
|
| 87 |
-
"assignees": ','.join(assignees)
|
| 88 |
-
}
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
-
|
| 100 |
-
print(f"List ID: {list_id}")
|
| 101 |
|
| 102 |
-
|
| 103 |
-
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
|
| 112 |
# Prepare ClickUp task payload
|
|
|
|
| 74 |
print(f"Start Date: {start_date}")
|
| 75 |
print(f"End Date: {end_date}")
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
web_app_url = "https://script.google.com/macros/s/AKfycby5hTb6dcWWJ6Q6vDm4mWHEnbOkLnM5rOFdyV7_nkh57-tZxSA7m4yPiHdEJsaR3XQR/exec"
|
| 79 |
+
params = {
|
| 80 |
+
"mode": "extended",
|
| 81 |
+
"taskType": task_type,
|
| 82 |
+
"company": team,
|
| 83 |
+
"assignees": ','.join(assignees)
|
| 84 |
+
}
|
| 85 |
|
| 86 |
+
response = requests.get(web_app_url, params=params)
|
| 87 |
+
try:
|
| 88 |
+
response_data = response.json()
|
| 89 |
+
except ValueError:
|
| 90 |
+
print("ERROR: Failed to decode JSON from web app response")
|
| 91 |
+
return {"error": "Invalid response from Google Apps Script"}
|
| 92 |
|
| 93 |
+
print(f"Web App Response: {response_data}")
|
|
|
|
| 94 |
|
| 95 |
+
list_id = response_data.get("listId")
|
| 96 |
+
print(f"List ID: {list_id}")
|
| 97 |
|
| 98 |
+
assignee_ids = response_data.get("assigneeIds", [])
|
| 99 |
+
print(f"Assignee IDs: {assignee_ids}")
|
| 100 |
|
| 101 |
+
assignee_numbers = response_data.get("assigneeNumbers", [])
|
| 102 |
+
manager_numbers = response_data.get("managerNumbers", [])
|
| 103 |
+
|
| 104 |
+
print(f"Assignee Numbers: {assignee_numbers}")
|
| 105 |
+
print(f"Manager Numbers: {manager_numbers}")
|
| 106 |
+
|
| 107 |
+
# Strategy task logic
|
| 108 |
+
if task_type.lower() == "content":
|
| 109 |
+
status = "to do"
|
| 110 |
+
print(f"Status: {status}")
|
| 111 |
|
| 112 |
|
| 113 |
# Prepare ClickUp task payload
|