{"record":{"id":"b361bea6ffed682b","repo":"wtfutil/wtf","slug":"missing-workspace-id","errorCode":null,"errorMessage":"missing workspace id","messagePattern":"missing workspace id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/asana/widget.go","lineNumber":120,"sourceCode":"\t} else {\n\t\twidget.settings.token = os.Getenv(\"WTF_ASANA_TOKEN\")\n\t}\n\n\tif widget.settings.token == \"\" {\n\t\treturn nil, fmt.Errorf(\"missing environment variable token or apikey config\")\n\t}\n\n\tsubMode := mode\n\tif allUsers && mode != \"workspace\" {\n\t\tsubMode += \"_all\"\n\t}\n\n\tif projectId == \"\" && strings.HasPrefix(subMode, \"project\") {\n\t\treturn nil, fmt.Errorf(\"missing project id\")\n\t}\n\n\tif workspaceId == \"\" && subMode == \"workspace\" {\n\t\treturn nil, fmt.Errorf(\"missing workspace id\")\n\t}\n\n\tvar tasks []*TaskItem\n\tvar err error\n\n\t//lint:ignore QF1002 An untagged switch makes sense here.\n\tswitch {\n\tcase strings.HasPrefix(subMode, \"project_sections\"):\n\t\ttasks, err = fetchTasksFromProjectSections(widget.settings.token, projectId, sections, subMode)\n\tcase strings.HasPrefix(subMode, \"project\"):\n\t\ttasks, err = fetchTasksFromProject(widget.settings.token, projectId, subMode)\n\tcase subMode == \"workspace\":\n\t\ttasks, err = fetchTasksFromWorkspace(widget.settings.token, workspaceId, subMode)\n\tdefault:\n\t\terr = fmt.Errorf(\"no mode found\")\n\t}\n\n\tif err != nil {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/asana/widget.go#L102-L138","documentation":"Validation guard in Fetch that fires only when mode is 'workspace' (or 'workspace_all' after the _all suffix is appended for allUsers) and the workspaceId setting is empty. Workspace mode cannot build an Asana query without a workspace identifier, so Fetch returns this error before calling the API. Fix by setting workspaceId in the widget config, or switching mode to a project-based mode which uses projectId instead.","triggerScenarios":"Thrown at modules/asana/widget.go:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set workspaceId in the Asana widget configuration","Find the workspace ID via the Asana API or admin console and add it to the config","Switch mode to project if a project-scoped view was intended instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}