diff --git a/troubleshooting/250930_naverworks_slack_04_lists_api_skill_integration.md b/troubleshooting/250930_naverworks_slack_04_lists_api_skill_integration.md index 893ec09..175bdf9 100644 --- a/troubleshooting/250930_naverworks_slack_04_lists_api_skill_integration.md +++ b/troubleshooting/250930_naverworks_slack_04_lists_api_skill_integration.md @@ -38,7 +38,27 @@ skill-slack에 올바른 Lists 엔드포인트 추가 → rb8001은 HTTP로만 | `Col09JQUKBSE6` | email | 이메일 주소 | | `Col09JQU6DF3L` | phone | 전화번호 | -**주의**: 컬럼 ID는 리스트마다 다를 수 있음 - 하드코딩 금지 +**주의**: 컬럼 ID는 리스트마다 다름 - 하드코딩 금지 + +--- + +## 컬럼 구조 동적 처리 전략 + +### 문제 +- 컬럼은 Slack에서 수동 추가/수정 가능 → 변경 시마다 코드/환경변수 수정 필요 + +### 해결 방안 +1. **slackLists.items.list로 컬럼 구조 조회** (권장) + - 응답에서 columns 정보 추출 + - 컬럼명(name)으로 column_id 자동 매핑 + - 예: "회사명" → Col09ABC123, "담당자" → Col09DEF456 +2. **환경변수로 column_id 관리** (수동) + - COLDMAIL_COLUMNS_MAP={"company":"Col09ABC123","contact":"Col09DEF456"} + - 컬럼 변경 시 환경변수 수동 업데이트 + +### 구현 권장 +- skill-slack/services/slack_lists_service.py에 `get_column_mapping(list_id)` 함수 추가 +- rb8001은 컬럼명만 전달, skill-slack이 자동 매핑 --- @@ -48,12 +68,12 @@ skill-slack에 올바른 Lists 엔드포인트 추가 → rb8001은 HTTP로만 - **엔드포인트**: `https://slack.com/api/slackLists.items.list` - **메서드**: POST - **요청**: `{"list_id": "...", "limit": 100}` -- **응답**: `{"ok": true, "items": [...]}` +- **응답**: `{"ok": true, "items": [...], "columns": [{"id": "Col00", "name": "완료", "type": "checkbox"}, ...]}` ### 아이템 생성 - **엔드포인트**: `https://slack.com/api/slackLists.items.create` - **메서드**: POST -- **요청**: `{"list_id": "...", "initial_fields": [...]}` +- **요청**: `{"list_id": "...", "initial_fields": [{"column_id": "Col00", "checkbox": false}, ...]}` - **응답**: `{"ok": true, "item": {"id": "..."}}` ---