{"record":{"id":"b3ba4885d8d52b93","repo":"phacility/phabricator","slug":"task-status-value-s-is-not-a-valid-task-statu","errorCode":null,"errorMessage":"Task status value (\"%s\") is not a valid task status. Valid statues are: %s.","messagePattern":"Task status value \\(\"(.+?)\"\\) is not a valid task status\\. Valid statues are: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/project/trigger/PhabricatorProjectTriggerManiphestStatusRule.php","lineNumber":24,"sourceCode":"  const TRIGGERTYPE = 'task.status';\n\n  public function getSelectControlName() {\n    return pht('Change status to');\n  }\n\n  protected function assertValidRuleRecordFormat($value) {\n    if (!is_string($value)) {\n      throw new Exception(\n        pht(\n          'Status rule value should be a string, but is not (value is \"%s\").',\n          phutil_describe_type($value)));\n    }\n  }\n\n  protected function assertValidRuleRecordValue($value) {\n    $map = ManiphestTaskStatus::getTaskStatusMap();\n    if (!isset($map[$value])) {\n      throw new Exception(\n        pht(\n          'Task status value (\"%s\") is not a valid task status. '.\n          'Valid statues are: %s.',\n          $value,\n          implode(', ', array_keys($map))));\n    }\n  }\n\n  protected function newDropTransactions($object, $value) {\n    return array(\n      $this->newTransaction()\n        ->setTransactionType(ManiphestTaskStatusTransaction::TRANSACTIONTYPE)\n        ->setNewValue($value),\n    );\n  }\n\n  protected function newDropEffects($value) {\n    $status_name = ManiphestTaskStatus::getTaskStatusName($value);","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/project/trigger/PhabricatorProjectTriggerManiphestStatusRule.php#L6-L42","documentation":"Thrown by assertValidRuleRecordValue() for the 'task.status' rule when the stored value is not a key of ManiphestTaskStatus::getTaskStatusMap(). The rule targets a status that does not exist on this install (the message's 'statues' is an upstream typo for 'statuses'). Validation runs at trigger save and when rules are re-checked.","triggerScenarios":"A trigger stores status key 'done' while the map only defines keys like 'open', 'resolved', 'wontfix' (or custom statuses). Saving or re-validating the trigger throws and lists the valid keys. Common after maniphest.statuses config changes or cross-instance imports.","commonSituations":"Custom status config (maniphest.statuses project option) removed or renamed a status after triggers were created; import from an instance with different status config; typo'd key in scripted records.","solutions":["Use the valid-key list in the error message.","Re-edit the trigger and choose a status that exists, then save.","If a needed status was removed by config, restore it or migrate all task.status trigger records to the replacement.","Sweep all task.status rule records and remap stale keys."],"exampleFix":"// before (key not in ManiphestTaskStatus::getTaskStatusMap())\n$value = 'done';\n\n// after\n$value = 'resolved';","handlingStrategy":"validation","validationCode":"$map = ManiphestTaskStatus::getTaskStatusMap();\nif (!isset($map[$value])) {\n  throw new Exception('Invalid status; valid: '.implode(', ', array_keys($map)));\n}","typeGuard":"function isValidStatusKeyword($value) {\n  return is_string($value)\n    && array_key_exists($value, ManiphestTaskStatus::getTaskStatusMap());\n}","tryCatchPattern":"$ex = $rule->getRuleRecordValueValidationException();\nif ($ex) { /* render valid-status list in the editor form */ }","preventionTips":["After editing maniphest.statuses config, audit existing task.status triggers.","Choose statuses from the dropdown; avoid hand-typed keys.","When importing triggers, remap status keys against the target map."],"tags":["php","phabricator","project-triggers","maniphest","status-config"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}