diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php index f403ccfa28..4d6f26a844 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_Method.php @@ -265,6 +265,8 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod { 'isClosed' => $task->isClosed(), 'priority' => ManiphestTaskPriority::getTaskPriorityName( $task->getPriority()), + 'priorityColor' => ManiphestTaskPriority::getTaskPriorityColor( + $task->getPriority()), 'title' => $task->getTitle(), 'description' => $task->getDescription(), 'projectPHIDs' => $task->getProjectPHIDs(), diff --git a/src/applications/maniphest/constants/ManiphestTaskPriority.php b/src/applications/maniphest/constants/ManiphestTaskPriority.php index 603acd2231..ec2663f6ee 100644 --- a/src/applications/maniphest/constants/ManiphestTaskPriority.php +++ b/src/applications/maniphest/constants/ManiphestTaskPriority.php @@ -64,6 +64,17 @@ final class ManiphestTaskPriority extends ManiphestConstants { return idx(self::getTaskPriorityMap(), $priority, $priority); } + /** + * Retrieve the color of the priority level given + * + * @param int A priority level. + * @return string The color of the priority if the level is valid, + * or black if it is not. + */ + public static function getTaskPriorityColor($priority) { + return idx(self::getColorMap(), $priority, 'black'); + } + private static function getConfig() { $config = PhabricatorEnv::getEnvConfig('maniphest.priorities');