Index: src/workflow/ArcanistTodoWorkflow.php =================================================================== --- src/workflow/ArcanistTodoWorkflow.php +++ src/workflow/ArcanistTodoWorkflow.php @@ -47,12 +47,19 @@ 'repeat' => true, 'help' => 'Other users to CC on the new task.', ), + 'proj' => array( + 'param' => 'proj', + 'short' => 'P', + 'repeat' => true, + 'help' => 'Assign task to this project.', + ), ); } public function run() { $summary = implode(' ', $this->getArgument('summary')); $ccs = $this->getArgument('cc'); + $projs = $this->getArgument('proj'); $conduit = $this->getConduit(); if (trim($summary) == '') { @@ -77,6 +84,26 @@ } $args['ccPHIDs'] = $phids; } + if (!$projs) { + $default_project = $this->getConfigFromAnySource('todo.default_project'); + if ($default_project) { + $projs[] = $default_project; + } + } + if ($projs) { + $phids = array(); + $projects = $conduit->callMethodSynchronous( + 'project.query', + array( + 'status' => 'status-active', + )); + foreach ($projects as $phid => $info) { + if (in_array($info['name'], $projs)) { + $phids[] = $info['phid']; + } + } + $args['projectPHIDs'] = $phids; + } $result = $conduit->callMethodSynchronous( 'maniphest.createtask',