Page MenuHomePhabricator

D7446.diff

diff --git a/src/workflow/ArcanistTodoWorkflow.php b/src/workflow/ArcanistTodoWorkflow.php
--- a/src/workflow/ArcanistTodoWorkflow.php
+++ b/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',

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/dg/jv/wrfinhtj52i2zpqx
Default Alt Text
D7446.diff (1 KB)

Event Timeline