{"record":{"id":"d4d1bedb726db14c","repo":"phacility/phabricator","slug":"you-can-not-bucket-results-by-required-action-with-d4d1be","errorCode":null,"errorMessage":"You can not bucket results by required action without specifying \"Responsible Users\".","messagePattern":"You can not bucket results by required action without specifying \"Responsible Users\"\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php","lineNumber":22,"sourceCode":"  extends DiffusionCommitResultBucket {\n\n  const BUCKETKEY = 'action';\n\n  private $objects;\n\n  public function getResultBucketName() {\n    return pht('Bucket by Required Action');\n  }\n\n  protected function buildResultGroups(\n    PhabricatorSavedQuery $query,\n    array $objects) {\n\n    $this->objects = $objects;\n\n    $phids = $query->getEvaluatedParameter('responsiblePHIDs');\n    if (!$phids) {\n      throw new Exception(\n        pht(\n          'You can not bucket results by required action without '.\n          'specifying \"Responsible Users\".'));\n    }\n    $phids = array_fuse($phids);\n\n    $groups = array();\n\n    $groups[] = $this->newGroup()\n      ->setName(pht('Needs Attention'))\n      ->setNoDataString(pht('None of your commits have active concerns.'))\n      ->setObjects($this->filterConcernRaised($phids));\n\n    $groups[] = $this->newGroup()\n      ->setName(pht('Needs Verification'))\n      ->setNoDataString(pht('No commits are awaiting your verification.'))\n      ->setObjects($this->filterNeedsVerification($phids));\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/query/DiffusionCommitRequiredActionResultBucket.php#L4-L40","documentation":"The 'Bucket by Required Action' result grouping organizes commits by what each responsible user must do (concerns raised, audits needed). It derives its groups from the query's 'Responsible Users' parameter; with that parameter empty there is nothing to bucket by, so buildResultGroups() throws rather than render an empty or meaningless bucket set.","triggerScenarios":"A saved query or dashboard selects the 'Required Action' bucket without any users in the 'Responsible Users' field, for example when a personal commit search reuses someone else's bucket configuration and the responsible-user default is lost.","commonSituations":"Users experimenting with bucket options on commit searches; dashboards copied between users; API-driven queries that set the bucket but not responsiblePHIDs.","solutions":["Add one or more users to the 'Responsible Users' field of the query","Or switch the result bucket to one that does not depend on responsible users (for example bucket by status or project)","When building queries programmatically, set responsiblePHIDs in the same call that enables the bucket"],"exampleFix":"// before: bucket selected, no responsible users\n$saved->setParameter('bucket', 'required');\n\n// after: bucket plus the parameter it depends on\n$saved->setParameter('bucket', 'required');\n$saved->setParameter('responsiblePHIDs', array($viewer->getPHID()));","handlingStrategy":"validation","validationCode":"// before selecting the bucket, verify its required parameter is present\n$phids = $saved_query->getEvaluatedParameter('responsiblePHIDs');\nif ($bucket_key === 'required' && (!$phids || !count($phids))) {\n  // prompt for Responsible Users instead of building groups\n}","typeGuard":"function bucketRequirementsSatisfied($bucket_key, array $parameters) {\n  if ($bucket_key !== 'required') { return true; }\n  return count(idx($parameters, 'responsiblePHIDs', array())) > 0;\n}","tryCatchPattern":"try {\n  $groups = $bucket->buildResultGroups($saved_query, $objects);\n} catch (Exception $ex) {\n  // render the query form with an error on the bucket selector\n}","preventionTips":["When copying dashboards or saved queries between users, re-check dependent parameters like Responsible Users","In code, always set responsiblePHIDs in the same change that enables the required-action bucket"],"tags":["search","bucketing","query-parameter","phabricator"],"backgroundTag":"missing-query-parameter","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}