Revisions and Commits
|Resolved||lpriestley||T5015 Allow Herald rules for Maniphest to act on task status changes|
|Resolved||None||T4420 Modernize typeahead datasources|
|Restricted Maniphest Task|
I think matching the new value is sufficient for already improved task routing e.g. status changes to "Verify" and project contains "iOS", assign to iOS QA.
I'm not sure I understand why this is a "typeahead" issue: it's that just a pop-up menu to choose the task status to act upon?
The rule will cover things like [Task status] [is any of] [X, Y, Z], similar to how other rules work. The X, Y, Z control will be a typeahead, to support multiple selections.
(We reasonably could use, like, a list of checkboxes, but for consistency it's cleaner to complete T4420 and drive this through that.)
BTW, this is something that we'd like to request as well -- our primary use case is that our developer relations people want to get alerts whenever we fix bugs in our API so we can notify the affected developers. Do we have any sort of an ETA on this?
See T4666 for a more general overview of Herald.
Currently, users can write Herald rules which check task edits in Maniphest and match against fields like Title, Body, etc. However, there's no way to match "Status" right now. The main reason for that is that "Status" is custom and configurable, so we need to do a little bit of work to produce a nice control.
To start with, build a typeahead datasource that returns available statuses.
- Subclass PhabricatorTypeaheadDatasource and put it in Maniphest as ManiphestTaskStatusDatasource or similar.
- PhabricatorTypeaheadMonogramDatasource is a reasonably good example.
- To build the actual results, load statuses with ManiphestTaskStatus::getTaskStatusMap(). ManiphestTaskStatus has other helpful methods.
- You can test your datasource at http://your.install.com/typeahead/class/. Searching for a string like "open" or "closed" in the "Query" field should return the relevant statuses.
Next, add a "Task Status" field to Herald:
- This will happen in HeraldManiphestTaskAdapter, with some changes in the parent class HeraldAdapter.
- You'll add a new FIELD_STATUS.
- You'll add a new VALUE_TASK_STATUSES.
- There's a small piece of ugly magic in HeraldRuleController->buildTokenizerTemplates() where you'll explicitly need to map your new VALUE to the appropriate typeahead datasource. Some day this will get less ugly as Herald becomes more modular.
When implemented, Maniphest rules in Herald should now expose a status field which lets you select several statuses via typeahead, like the example above:
[Task status] [is any of] [X, Y, Z]
Question: When subtask was fixed, the parent task want to have a action, for example, add a tag or change status if all subtasks were fixed.
So how to get this work in the extention of herald action? Thanks in advance!~