Page MenuHomePhabricator

Allow prefilling a task's assignee by his PHID
ClosedPublic

Authored by erik.fercak on Oct 25 2013, 6:19 PM.
Tags
None
Referenced Files
F13386615: D7401.diff
Mon, Jul 1, 5:29 AM
F13351911: D7401.diff
Sun, Jun 23, 10:42 AM
F13302843: D7401.diff
Sat, Jun 8, 5:52 AM
F13286891: D7401.diff
Tue, Jun 4, 7:50 AM
F13279723: D7401.id16672.diff
Jun 1 2024, 11:05 PM
F13279722: D7401.id.diff
Jun 1 2024, 11:05 PM
F13279721: D7401.diff
Jun 1 2024, 11:05 PM
F13273836: D7401.diff
May 31 2024, 2:47 AM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP203d82083a98: Allow prefilling a task's assignee by his PHID
Summary

Some scripts might find it easier to work with PHIDs instead of user names.

Test Plan

Use ?assign=<username> and ?assign=<PHID-USER> with the create task URI.
See assignee input being filled correctly.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I could fetch possible user with one query (username = %s or phid = %s) but this seems cleaner. Your call.

Let's switch to PhabricatorPeopleQuery, too -- you can use:

$assign_user = id(new PhabricatorPeopleQuery())
  ->setViewer($user)
  ->withUsernames(array($assign))
  ->executeOne()

...to get similar semantics to loadOneWhere(). This looks great to me otherwise.

(PhabricatorPeopleQuery might make more sense as PhabricatorUserQuery, but for random historical reasons the application is called "People" so we've ended up with awkardly mixed terminology. It loads PhabricatorUser objects, though.)

I did ack for PhabricatorUserQuery:)

erik.fercak updated this revision to Unknown Object (????).Oct 25 2013, 6:34 PM

Grab user with PhabricatorPeopleQuery.