---
apiVersion: data-spec/v1
id: task-weekly-update-subject-picklist-20260422
description: "Convert Task.Subject to a picklist for Weekly Update categorization"
issue: "#1545"
created: 2026-04-22
scope: production-only
status: pending
tables: [_System_Field]
depends_on: []
---

# Task Weekly Update Subject Picklist

## Summary

`Task.Subject` currently describes as a plain string field in the local runtime,
so the Weekly Update modal cannot offer standardized Subject values. `Task` is a
discovered object, so this fix belongs in production metadata rather than
bootstrap code.

This spec converts `Task.Subject` to a picklist and seeds the approved Weekly
Update categories:

- Initial Engagement
- Technical Engagement
- Business Engagement
- Mixed Engagement
- IQM Scheduled
- IQM Completed

The paired frontend change for issue `#1545` reads Task metadata at runtime and
renders the Weekly Update Subject as a dropdown whenever this picklist metadata
is present.

## Changes

### 1. Convert `Task.Subject` to a picklist with the approved Weekly Update values

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET
  f.Type = 'picklist',
  f.Options = JSON_ARRAY(
    JSON_OBJECT('value', 'Initial Engagement', 'label', 'Initial Engagement'),
    JSON_OBJECT('value', 'Technical Engagement', 'label', 'Technical Engagement'),
    JSON_OBJECT('value', 'Business Engagement', 'label', 'Business Engagement'),
    JSON_OBJECT('value', 'Mixed Engagement', 'label', 'Mixed Engagement'),
    JSON_OBJECT('value', 'IQM Scheduled', 'label', 'IQM Scheduled'),
    JSON_OBJECT('value', 'IQM Completed', 'label', 'IQM Completed')
  ),
  f.DefaultValue = 'Initial Engagement',
  f.LastModifiedDate = CURRENT_TIMESTAMP
WHERE o.ApiName = 'Task'
  AND f.ApiName = 'Subject'
  AND (
    COALESCE(f.Type, '') <> 'picklist'
    OR COALESCE(f.DefaultValue, '') <> 'Initial Engagement'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[0].value'), '') <> 'Initial Engagement'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[1].value'), '') <> 'Technical Engagement'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[2].value'), '') <> 'Business Engagement'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[3].value'), '') <> 'Mixed Engagement'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[4].value'), '') <> 'IQM Scheduled'
    OR COALESCE(JSON_EXTRACT(f.Options, '$[5].value'), '') <> 'IQM Completed'
  );
```

**Idempotency**: Re-running the update converges `Task.Subject` to the same
picklist type, option set, and default value. The guarded `WHERE` clause avoids
touching already-correct rows.

## Verification

```sql
SELECT
  o.ApiName AS ObjectApiName,
  f.ApiName AS FieldApiName,
  f.Type,
  f.DefaultValue,
  f.Options
FROM _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
WHERE o.ApiName = 'Task'
  AND f.ApiName = 'Subject';
```

Expected:

- `Type = picklist`
- `DefaultValue = Initial Engagement`
- `Options` contains all six standardized Weekly Update values

## Rollback

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET
  f.Type = 'string',
  f.Options = NULL,
  f.DefaultValue = NULL,
  f.LastModifiedDate = CURRENT_TIMESTAMP
WHERE o.ApiName = 'Task'
  AND f.ApiName = 'Subject';
```
