Update app.py
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ async def create_task(request: Request):
|
|
| 79 |
status = "to do"
|
| 80 |
print(f"Status: {status}")
|
| 81 |
|
| 82 |
-
web_app_url = "https://script.google.com/macros/s/
|
| 83 |
params = {
|
| 84 |
"mode": "extended",
|
| 85 |
"taskType": task_type,
|
|
@@ -88,7 +88,12 @@ async def create_task(request: Request):
|
|
| 88 |
}
|
| 89 |
|
| 90 |
response = requests.get(web_app_url, params=params)
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
print(f"Web App Response: {response_data}")
|
| 93 |
|
| 94 |
list_id = response_data.get("listId")
|
|
@@ -97,8 +102,12 @@ async def create_task(request: Request):
|
|
| 97 |
assignee_ids = response_data.get("assigneeIds", [])
|
| 98 |
print(f"Assignee IDs: {assignee_ids}")
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
# Prepare ClickUp task payload
|
| 104 |
payload = {
|
|
|
|
| 79 |
status = "to do"
|
| 80 |
print(f"Status: {status}")
|
| 81 |
|
| 82 |
+
web_app_url = "https://script.google.com/macros/s/AKfycbxe4yF7kfk6Y1tv70p2Ugg_JHB3KRanFA4rgoZmxITAYvt4sOFODg9UELO9AzBUDSee/exec"
|
| 83 |
params = {
|
| 84 |
"mode": "extended",
|
| 85 |
"taskType": task_type,
|
|
|
|
| 88 |
}
|
| 89 |
|
| 90 |
response = requests.get(web_app_url, params=params)
|
| 91 |
+
try:
|
| 92 |
+
response_data = response.json()
|
| 93 |
+
except ValueError:
|
| 94 |
+
print("ERROR: Failed to decode JSON from web app response")
|
| 95 |
+
return {"error": "Invalid response from Google Apps Script"}
|
| 96 |
+
|
| 97 |
print(f"Web App Response: {response_data}")
|
| 98 |
|
| 99 |
list_id = response_data.get("listId")
|
|
|
|
| 102 |
assignee_ids = response_data.get("assigneeIds", [])
|
| 103 |
print(f"Assignee IDs: {assignee_ids}")
|
| 104 |
|
| 105 |
+
assignee_numbers = response_data.get("assigneeNumbers", [])
|
| 106 |
+
manager_numbers = response_data.get("managerNumbers", [])
|
| 107 |
+
|
| 108 |
+
print(f"Assignee Numbers: {assignee_numbers}")
|
| 109 |
+
print(f"Manager Numbers: {manager_numbers}")
|
| 110 |
+
|
| 111 |
|
| 112 |
# Prepare ClickUp task payload
|
| 113 |
payload = {
|