{
  "id": "TSK-004",
  "name": "Weekly Update create defaults OwnerId and Priority",
  "description": "Regression for #1457. Creating a Weekly Update task should succeed even when the client omits OwnerId and Priority. The backend must default OwnerId to the current user and fill Priority instead of rejecting the save.",
  "object": "Task",
  "method": "POST",
  "endpoint": "/services/data/v63.0/sobjects/Task",
  "setup": [
    {
      "type": "sql",
      "name": "Create fixed Opportunity for TSK-004",
      "sql": "INSERT INTO Opportunity (Id, Name, StageName, CloseDate, IsDeleted, CreatedDate, LastModifiedDate, SystemModstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
      "params": [
        "tsk004-opp-01",
        "TSK-004 Weekly Update Opp",
        "Prospecting",
        "2026-12-31",
        0,
        "{db_timestamp}",
        "{db_timestamp}",
        "{db_timestamp}"
      ]
    }
  ],
  "payload": {
    "Subject": "Weekly Update",
    "Status": "Completed",
    "ActivityDate": "2026-04-24",
    "WhatId": "tsk004-opp-01",
    "Progress__c": "Regression covered by e2e-api.",
    "Risk_and_Next_Step__c": "Verify defaults are applied."
  },
  "expects": {
    "status_code": 201
  },
  "query_after": {
    "object": "Task",
    "assertions": [
      {
        "field": "OwnerId",
        "operator": "is_not_null",
        "value": true
      },
      {
        "field": "Priority",
        "operator": "is_not_null",
        "value": true
      }
    ]
  },
  "teardown": [
    {
      "method": "DELETE",
      "endpoint": "/services/data/v63.0/sobjects/Task/{id}"
    },
    {
      "type": "sql",
      "sql": "DELETE FROM Opportunity WHERE Id = %s",
      "params": [
        "tsk004-opp-01"
      ]
    }
  ],
  "priority": "P0",
  "bug_ref": "#1457",
  "scene": "task",
  "skip": true,
  "skip_reason": "Regression case added from recent UAT-Test P0 fixes, but current product behavior on main still requires explicit Task.OwnerId for Weekly Update create"
}
