{"record":{"id":"221cd7474b5c25b9","repo":"phacility/phabricator","slug":"task-priority-value-s-is-not-a-valid-task-pri","errorCode":null,"errorMessage":"Task priority value (\"%s\") is not a valid task priority. Valid priorities are: %s.","messagePattern":"Task priority value \\(\"(.+?)\"\\) is not a valid task priority\\. Valid priorities are: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/project/trigger/PhabricatorProjectTriggerManiphestPriorityRule.php","lineNumber":24,"sourceCode":"  const TRIGGERTYPE = 'task.priority';\n\n  public function getSelectControlName() {\n    return pht('Change priority to');\n  }\n\n  protected function assertValidRuleRecordFormat($value) {\n    if (!is_string($value)) {\n      throw new Exception(\n        pht(\n          'Priority 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 = ManiphestTaskPriority::getTaskPriorityMap();\n    if (!isset($map[$value])) {\n      throw new Exception(\n        pht(\n          'Task priority value (\"%s\") is not a valid task priority. '.\n          'Valid priorities are: %s.',\n          $value,\n          implode(', ', array_keys($map))));\n    }\n  }\n\n  protected function newDropTransactions($object, $value) {\n    $value = ManiphestTaskPriority::getKeywordForTaskPriority($value);\n    return array(\n      $this->newTransaction()\n        ->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE)\n        ->setNewValue($value),\n    );\n  }\n\n  protected function newDropEffects($value) {","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/project/trigger/PhabricatorProjectTriggerManiphestPriorityRule.php#L6-L42","documentation":"Thrown by assertValidRuleRecordValue() for the 'task.priority' rule when the stored keyword is not a key of ManiphestTaskPriority::getTaskPriorityMap(). This is save/re-validation time: the rule points at a priority that no longer exists in this install's configuration.","triggerScenarios":"A trigger stores priority keyword '25' but the install's maniphest.custom-priorities config removed/rekeyed it; saving or validating the trigger throws, listing the currently valid keywords. Also hit when a hand-built record uses an invented keyword.","commonSituations":"An admin edited maniphest.custom-priorities (renamed or dropped a priority) after triggers were configured; triggers migrated from another instance with different priority config; typo in a scripted value.","solutions":["Read the error text: it lists all valid priority keywords for this install.","Re-open the trigger editor and pick one of the currently valid priorities, then save.","If the keyword was removed by a config change, either restore it in maniphest.custom-priorities or retarget every affected trigger.","Audit other rules of type task.priority: SELECT * FROM phabricator_project_trigger_rule_record WHERE type='task.priority'; and align values with the map."],"exampleFix":"// before (keyword no longer defined)\n$value = '25';\n\n// after (a key of ManiphestTaskPriority::getTaskPriorityMap())\n$value = '20';","handlingStrategy":"validation","validationCode":"// Before saving:\n$map = ManiphestTaskPriority::getTaskPriorityMap();\nif (!isset($map[$value])) {\n  throw new Exception('Invalid priority; valid: '.implode(', ', array_keys($map)));\n}","typeGuard":"function isValidPriorityKeyword($value) {\n  return is_string($value)\n    && array_key_exists($value, ManiphestTaskPriority::getTaskPriorityMap());\n}","tryCatchPattern":"$ex = $rule->getRuleRecordValueValidationException();\nif ($ex) { /* show message listing valid priorities in editor */ }","preventionTips":["Re-validate task.priority triggers after changing maniphest.custom-priorities.","Select priorities from the editor dropdown, never free-typed keywords.","Keep priority keywords stable across config revisions or write a migration."],"tags":["php","phabricator","project-triggers","maniphest","priority-config"],"backgroundTag":"invalid-enum-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}