Page MenuHomePhabricator

Is it possible to search by a custom field with maniphest.search?
OpenPublic

Asked by ftdysa on Jan 31 2017, 5:15 PM.

Details

There is some discussion in T12137 about what I'm trying to accomplish. Basically, I'd like to automatically file bug reports from application exceptions/errors. To do that, I need to first determine if there has already been a task created for a unique exception so that I am not creating duplicates.

In T12137, @epriestley suggested that custom fields would be better for this than sticking a hash in the task description. I've created the custom field that I am going to use and have confirmed that searching for it via the web UI works as expected.

Here's that config:

"myapp:error-hash": {
    "name": "Error Hash",
    "type": "text",
    "caption": "Unique hash that identifies a specific application error.",
    "search": true
}

Now, I can't quite figure out the correct constraint name to use for this. Here is what I've tried so far:

  • custom.myapp:error-hash (tried from reading D14758)
  • myapp:error-hash (custom field key)
  • std:maniphest:myapp:error-hash - (what appears to be the name/key used by application search in web UI)
  • custom.std:maniphest:myapp:error-hash

These all return the following error:

array (
  'error' => 'ERR-CONDUIT-CORE',
  'errorInfo' => 'Constraint "custom.std:maniphest:myapp:error-hash" is not a valid constraint for this query.',
  'result' => NULL,
)

Here is an example API call: (in case the format is incorrect)

echo '{"constraints": {"custom.myapp:error-hash": "test"}}' | arc call-conduit --conduit-uri http://phabricator.xxxx.com/ --conduit-token "xxxx" maniphest.search
{"error":"ERR-CONDUIT-CORE","errorMessage":"ERR-CONDUIT-CORE: Constraint \"custom.myapp:error-hash\" is not a valid constraint for this query.","response":null}

Am I missing something here or is searching for custom fields in maniphest just not supported yet?

Answers

ftdysa
Updated 864 Days Ago

Simply changing the custom field type from text to link made this work. Not sure if that is expected or not ...

New Answer