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
Unknown Object (File)
Tue, Jun 17, 12:38 AM
Unknown Object (File)
Mon, Jun 16, 8:10 PM
Unknown Object (File)
Mon, Jun 16, 4:41 PM
Unknown Object (File)
Mon, Jun 16, 3:04 PM
Unknown Object (File)
Sun, Jun 15, 2:07 PM
Unknown Object (File)
Jun 7 2025, 3:02 AM
Unknown Object (File)
May 17 2025, 3:34 AM
Unknown Object (File)
May 17 2025, 3:34 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.