Page MenuHomePhabricator

New Column Trigger: When moving to a column, assign to the "current user" (user that is performing the move)
Closed, ResolvedPublicFeature

Description

To avoid having unassigned work in progress, we should have the ability to create new triggers under the columns, similar to what exists now, but instead of assigning to a concrete user, we should be able to assign to the person who has performed the column movement.

Context: https://www.mediawiki.org/wiki/Phabricator/Project_management#Automated_actions_via_column_triggers

Upstream: https://we.phorge.it/T16058

Event Timeline

Aklapper triaged this task as Low priority.
Aklapper changed the subtype of this task from "Task" to "Feature Request".

Quick patch, seems to work but needs much more testing:

1diff --git a/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php b/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
2index f2d4c8b117..b093607e40 100644
3--- a/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
4+++ b/src/applications/maniphest/typeahead/ManiphestAssigneeDatasource.php
5@@ -13,6 +13,7 @@ final class ManiphestAssigneeDatasource
6
7 public function getComponentDatasources() {
8 return array(
9+ new PhabricatorViewerDatasource(), // what could go wrong, shrug
10 new PhabricatorPeopleDatasource(),
11 new PhabricatorPeopleNoOwnerDatasource(),
12 );
13diff --git a/src/applications/people/typeahead/PhabricatorViewerDatasource.php b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
14index cb367ccd4d..e61660f4af 100644
15--- a/src/applications/people/typeahead/PhabricatorViewerDatasource.php
16+++ b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
17@@ -3,6 +3,8 @@
18 final class PhabricatorViewerDatasource
19 extends PhabricatorTypeaheadDatasource {
20
21+ const FUNCTION_TOKEN = 'viewer()'; // same game as in PhabricatorPeopleNoOwnerDatasource
22+
23 public function getBrowseTitle() {
24 return pht('Browse Viewer');
25 }
26diff --git a/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php b/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
27index 1648f1bc8b..a94d1a243d 100644
28--- a/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
29+++ b/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php
30@@ -18,6 +18,9 @@ final class PhabricatorProjectTriggerManiphestOwnerRule
31 if ($value === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {
32 $value = null;
33 }
34+ if ($value === PhabricatorViewerDatasource::FUNCTION_TOKEN) {
35+ $value = $this->getViewer()->getPHID();
36+ }
37 return $value;
38 }
39
40@@ -123,7 +126,12 @@ final class PhabricatorProjectTriggerManiphestOwnerRule
41 }
42
43 public function getRuleViewDescription($value) {
44- $value = $this->convertTokenizerValueToOwner($value);
45+ if (head($value) === PhabricatorViewerDatasource::FUNCTION_TOKEN) {
46+ // TODO: This string concatenation breaks 18n because of grammatical case
47+ $value = 'the viewer who dropped the card';
48+ } else {
49+ $value = $this->convertTokenizerValueToOwner($value);
50+ }
51
52 if (!$value) {
53 return pht('Unassign task.');

I want to reflect here on an implicit requirement (making it explicit), as the problem that we want to solve is (quoting myself on the description)

To avoid having unassigned work in progress

The issue should be unassigned

Aklapper updated the task description. (Show Details)
Aklapper moved this task from Backlog to Hacking projects on the Wikimedia-Hackathon-2025 board.
Aklapper moved this task from Backlog to Upstreamed on the Phabricator (Upstream) board.
Aklapper moved this task from Backlog to Reported Upstream on the Upstream board.

I want to reflect here on an implicit requirement (making it explicit), as the problem that we want to solve is (quoting myself on the description)

To avoid having unassigned work in progress

The issue should be unassigned

Trigger rules don't allow setting any conditions when to trigger.
Supporting a check whether the issue was previously unassigned will probably need to be a separate rule / condition; something like "Assign unassigned task to..."
I'd say split into a separate feature request task and make it depend on this one. :)

This issue should now be fixed on phabricator.wikimedia.org after today's software deployment in T404134.