phacility/phabricator · error · Exception

Owner rule value is required. Specify a user to assign tasks

Error message

Owner rule value is required. Specify a user to assign tasks to, or the token "none()" to unassign tasks.

What it means

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.

Source

Thrown at src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php:35

    $value = head($value);
    if ($value === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {
      $value = null;
    }
    return $value;
  }

  protected function assertValidRuleRecordFormat($value) {
    if (!is_array($value)) {
      throw new Exception(
        pht(
          'Owner rule value should be a list, but is not (value is "%s").',
          phutil_describe_type($value)));
    }
  }

  protected function assertValidRuleRecordValue($value) {
    if (!$value) {
      throw new Exception(
        pht(
          'Owner rule value is required. Specify a user to assign tasks '.
          'to, or the token "none()" to unassign tasks.'));
    }

    if (count($value) > 1) {
      throw new Exception(
        pht(
          'Owner rule value must have only one elmement (value is "%s").',
          implode(', ', $value)));
    }

    $owner_phid = $this->convertTokenizerValueToOwner($value);
    if ($owner_phid !== null) {
      $user = id(new PhabricatorPeopleQuery())
        ->setViewer($this->getViewer())
        ->withPHIDs(array($owner_phid))
        ->executeOne();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Edit the trigger and select a user, or type the token none() to make the rule unassign tasks.
  2. If the user tokenizer shows no results, check user visibility policies for the editing user.
  3. When writing the trigger via scripts/Conduit, post a one-element array such as ['PHID-USER-abc'] or ['none()'].

Example fix

// before
$value = array();

// after
$value = array('PHID-USER-abc');
// or: $value = array('none()');
Defensive patterns

Strategy: validation

Validate before calling

// Before applying/saving:
if (!is_array($value) || count($value) === 0) {
  throw new Exception('Owner rule requires one user or "none()".');
}

Type guard

function hasOwnerSelection($value) {
  return is_array($value) && count($value) >= 1;
}

Try / catch

$ex = $rule->getRuleRecordValueValidationException();
if ($ex) { /* show $ex->getMessage() next to the owner field */ }

Prevention

When it happens

Trigger: 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.

Common situations: User leaves the owner tokenizer empty; tokenizer datasource failed so the field stayed blank; API client posts an empty array for task.owner.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/1c9217857b6aa6ed. Report an issue: GitHub.