{"record":{"id":"1c9217857b6aa6ed","repo":"phacility/phabricator","slug":"owner-rule-value-is-required-specify-a-user-to-as","errorCode":null,"errorMessage":"Owner rule value is required. Specify a user to assign tasks to, or the token \"none()\" to unassign tasks.","messagePattern":"Owner rule value is required\\. Specify a user to assign tasks to, or the token \"none\\(\\)\" to unassign tasks\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php","lineNumber":35,"sourceCode":"    $value = head($value);\n    if ($value === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {\n      $value = null;\n    }\n    return $value;\n  }\n\n  protected function assertValidRuleRecordFormat($value) {\n    if (!is_array($value)) {\n      throw new Exception(\n        pht(\n          'Owner rule value should be a list, but is not (value is \"%s\").',\n          phutil_describe_type($value)));\n    }\n  }\n\n  protected function assertValidRuleRecordValue($value) {\n    if (!$value) {\n      throw new Exception(\n        pht(\n          'Owner rule value is required. Specify a user to assign tasks '.\n          'to, or the token \"none()\" to unassign tasks.'));\n    }\n\n    if (count($value) > 1) {\n      throw new Exception(\n        pht(\n          'Owner rule value must have only one elmement (value is \"%s\").',\n          implode(', ', $value)));\n    }\n\n    $owner_phid = $this->convertTokenizerValueToOwner($value);\n    if ($owner_phid !== null) {\n      $user = id(new PhabricatorPeopleQuery())\n        ->setViewer($this->getViewer())\n        ->withPHIDs(array($owner_phid))\n        ->executeOne();","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php#L17-L53","documentation":"Thrown by assertValidRuleRecordValue() for the 'task.owner' rule when the value list is empty. This is save-time validation from getRuleRecordValueValidationException(): an 'Assign Owner' rule was configured with no owner selected. The rule needs exactly one user PHID or the special 'none()' token.","triggerScenarios":"In the trigger editor, add an 'Assign task owner' rule and save without choosing a user. Also triggers when a stored record has value [] and is re-validated or applied to a dropped card.","commonSituations":"User leaves the owner tokenizer empty; tokenizer datasource failed so the field stayed blank; API client posts an empty array for task.owner.","solutions":["Edit the trigger and select a user, or type the token none() to make the rule unassign tasks.","If the user tokenizer shows no results, check user visibility policies for the editing user.","When writing the trigger via scripts/Conduit, post a one-element array such as ['PHID-USER-abc'] or ['none()']."],"exampleFix":"// before\n$value = array();\n\n// after\n$value = array('PHID-USER-abc');\n// or: $value = array('none()');","handlingStrategy":"validation","validationCode":"// Before applying/saving:\nif (!is_array($value) || count($value) === 0) {\n  throw new Exception('Owner rule requires one user or \"none()\".');\n}","typeGuard":"function hasOwnerSelection($value) {\n  return is_array($value) && count($value) >= 1;\n}","tryCatchPattern":"$ex = $rule->getRuleRecordValueValidationException();\nif ($ex) { /* show $ex->getMessage() next to the owner field */ }","preventionTips":["Make the owner tokenizer required in your workflow before submit.","Default the field to none() when unassignment is the intent.","Script clients should post ['PHID-USER-...'] or ['none()'], never []."],"tags":["php","phabricator","project-triggers","form-validation"],"backgroundTag":"required-field-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}