Add person resolver: email → LookupId for writing person columns
Person/group columns store a numeric LookupId into each site's hidden User Information List, and SPO's ensureUser needs certificate auth that client secrets can't provide — so resolve by querying the hidden list directly via Graph (item id IS the LookupId). New resolvePersonByEmail() in graph.mjs (server-side EMail/UserName filter with a paged case-insensitive scan fallback), a 'person' CLI command, and a sharepoint_resolve_person MCP tool (9 tools now). Verified live against known ground truth (LookupIds 53 and 136) plus the not-found path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,14 @@ often differ from their display names (a column shown as "Due Date" may be
|
||||
[references/graph-api.md](references/graph-api.md) for field-type formats
|
||||
(person, lookup, choice, date, etc.) and OData query details.
|
||||
|
||||
To write a **person column**, first resolve the person's email to the numeric
|
||||
LookupId the column stores, then write `<Column>LookupId`:
|
||||
|
||||
```bash
|
||||
node scripts/sp.mjs person --site "<SITE_URL>" --email user@domain.com
|
||||
# → {"lookupId": 53, ...}; then: --fields '{"ProjectManagerLookupId": 53}'
|
||||
```
|
||||
|
||||
## Reading items
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user