Page MenuHomePhabricator

D7446.id.diff
No OneTemporary

D7446.id.diff

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',

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 24, 10:42 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713932
Default Alt Text
D7446.id.diff (1 KB)

Event Timeline