phacility/phabricator · error · Exception

You must select at least one project tag to remove.

Error message

You must select at least one project tag to remove.

What it means

Thrown by assertValidRuleRecordValue() for the 'task.projects.remove' rule when the value list is empty. This is save-time validation through getRuleRecordValueValidationException(): a 'Remove project tags' rule was configured without selecting any project to remove.

Source

Thrown at src/applications/project/trigger/PhabricatorProjectTriggerRemoveProjectsRule.php:28

  }

  protected function getValueForEditorField() {
    return $this->getDatasource()->getWireTokens($this->getValue());
  }

  protected function assertValidRuleRecordFormat($value) {
    if (!is_array($value)) {
      throw new Exception(
        pht(
          'Remove project 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(
          'You must select at least one project tag to remove.'));
    }
  }

  protected function newDropTransactions($object, $value) {
    $project_edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;

    $xaction = $object->getApplicationTransactionTemplate()
      ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
      ->setMetadataValue('edge:type', $project_edge_type)
      ->setNewValue(
        array(
          '-' => array_fuse($value),
        ));

    return array($xaction);
  }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Open the trigger and select at least one project tag to remove, then save.
  2. If the tokenizer cannot find the project, check the project exists and is visible to the editing user.
  3. When creating triggers programmatically, post a non-empty array of project PHIDs.

Example fix

// before
$value = array();

// after
$value = array('PHID-PROJ-xyz');
Defensive patterns

Strategy: validation

Validate before calling

if (!$value) {
  throw new Exception('Select at least one project tag to remove.');
}

Type guard

function isNonEmptyProjectRemovalList($value) {
  return is_array($value) && count($value) > 0;
}

Try / catch

$ex = $rule->getRuleRecordValueValidationException();
if ($ex) { /* inline message in editor near the tokenizer */ }

Prevention

When it happens

Trigger: In the trigger editor, add a 'Remove project tags' rule and save with an empty tokenizer. Also fires when a stored record holds an empty array and is re-validated or applied.

Common situations: User picked the rule type but selected no projects; the project datasource returned nothing (policy or search issue); an API/script client posted an empty list.

Related errors


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