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
F14067391: D7401.diff
Tue, Nov 19, 2:50 PM
F14053339: D7401.diff
Fri, Nov 15, 3:01 PM
F14040791: D7401.diff
Mon, Nov 11, 1:31 PM
F14022469: D7401.diff
Wed, Nov 6, 5:49 PM
F13967415: D7401.diff
Oct 16 2024, 1:29 PM
Unknown Object (File)
Oct 13 2024, 1:32 PM
Unknown Object (File)
Oct 3 2024, 1:58 PM
Unknown Object (File)
Oct 3 2024, 1:54 PM

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.