diff --git a/conf/default.conf.php b/conf/default.conf.php index 4666e05d01..ce8580c5d6 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -1057,6 +1057,11 @@ // Adding Custom Fields" in the documentation for more information. 'maniphest.custom-task-extensions-class' => 'ManiphestDefaultTaskExtensions', + // What should the default task priority be in create flows? + // See the constants in @{class:ManiphestTaskPriority} for valid values. + // Defaults to "needs triage". + 'maniphest.default-priority' => 90, + // -- Phriction ------------------------------------------------------------- // 'phriction.enabled' => true, diff --git a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_createtask_Method.php b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_createtask_Method.php index bc6c49adaf..5ef413fde2 100644 --- a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_createtask_Method.php +++ b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_createtask_Method.php @@ -42,7 +42,7 @@ public function defineErrorTypes() { protected function execute(ConduitAPIRequest $request) { $task = new ManiphestTask(); - $task->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); + $task->setPriority(ManiphestTaskPriority::getDefaultPriority()); $task->setAuthorPHID($request->getUser()->getPHID()); $this->applyRequest($task, $request, $is_new = true); diff --git a/src/applications/maniphest/ManiphestReplyHandler.php b/src/applications/maniphest/ManiphestReplyHandler.php index d1959dd23e..233845fb0b 100644 --- a/src/applications/maniphest/ManiphestReplyHandler.php +++ b/src/applications/maniphest/ManiphestReplyHandler.php @@ -87,6 +87,7 @@ protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { $task->setAuthorPHID($user->getPHID()); $task->setTitle(nonempty($mail->getSubject(), 'Untitled Task')); $task->setDescription($body); + $task->setPriority(ManiphestTaskPriority::getDefaultPriority()); } else { $lines = explode("\n", trim($body)); diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php index 4b8185f218..506e14fe9f 100644 --- a/src/applications/maniphest/constants/ManiphestTaskPriority.php +++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php @@ -93,6 +93,17 @@ public static function getLowestPriority() { public static function getHighestPriority() { return self::PRIORITY_UNBREAK_NOW; } + /** + * Return the default priority for this instance of Phabricator. + * + * @return int The value of the default priority constant. + */ + public static function getDefaultPriority() { + return PhabricatorEnv::getEnvConfig( + 'maniphest.default-priority', + self::PRIORITY_TRIAGE + ); + } /** * Retrieve the full name of the priority level provided. @@ -104,4 +115,5 @@ public static function getHighestPriority() { public static function getTaskPriorityName($priority) { return idx(self::getTaskPriorityMap(), $priority, '???'); } + } diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index ab48d6c89f..dd687a4f93 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -43,7 +43,7 @@ public function processRequest() { } } else { $task = new ManiphestTask(); - $task->setPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); + $task->setPriority(ManiphestTaskPriority::getDefaultPriority()); $task->setAuthorPHID($user->getPHID()); // These allow task creation with defaults.