Page MenuHomePhabricator

Custom field with users goes wrong when create task via maniphest.createtask API
Closed, ResolvedPublic

Description

We are making some internal and want to create task according to other system automatically. but during test we hit issue in users type custom field. as example, we have a custom field called dev owner with below config:

"tkec:dev-owner": {
  "name": "Dev Owner",
  "type": "users",
  "search": true,
  "copy": true,
  "required": false
}

You can see I have assigned the value for this custom field when call API, and it shows me that succeed. But when I try to open the ticket, it tells me wrong. but if I do not assign value to custom field (dev owner), every things goes well. Can anyone help on this?

Screenshot - 2015_6_30 , 14_47_42.png (743×1 px, 35 KB)

Screenshot - 2015_6_30 , 15_01_44.png (420×1 px, 145 KB)

Attached error log for the reference.

Event Timeline

tao_qiping raised the priority of this task from to Needs Triage.
tao_qiping updated the task description. (Show Details)
tao_qiping added a project: Conduit.
tao_qiping shifted this object from the S1 Core space to the S3 Hyperspace space.
tao_qiping added a subscriber: tao_qiping.

Is there a stack trace for that error in your error log (often /var/log/apache2/error.log or similar)?

That's not an error I recognize.

chad shifted this object from the S3 Hyperspace space to the S1 Core space.Jun 30 2015, 1:31 PM

Is there a stack trace for that error in your error log (often /var/log/apache2/error.log or similar)?

That's not an error I recognize.

Yes, I found error log, pls refer the new attached file.

anyone looking at this?
I attached log file.

The error message says it expects a string and you are passing an array.

but when I passed a string, error again. and actually when I create task in page, we can select multiple users.

What should I passed to user type custom field in API?

Screenshot - 2015_7_3 , 14_32_36.png (231×1 px, 15 KB)

below is my auxiliary value when call the API:
{"std:maniphest:tkec:request-type":"1", "std:maniphest:tke:system":"51","std:maniphest:tkec:dev-owner":"PHID-USER-hl2rqmkh7x3gsiwansti"}

any findings? it blocks us for a internal tool.

This generally falls outside what we provide free support for:
https://secure.phabricator.com/book/phabcontrib/article/bug_reports/#supported-issues

Specifically:

We do NOT support custom code development or third-party libraries. If you're writing an extension, you're on your own. We provide some documentation, but can not help you with extension or library development. If you downloaded a library from somewhere, contact the library maintainer.

In this case, I'm not able to reproduce the issue you describe. I can set a custom field for users and I'm able to call conduit and create tasks against the field populated.

tao_qiping claimed this task.

Thanks chad. It is not require you to support our code, but confirming if there is any bug in API, or how to use API.

Good news is that I found the issue by comparing with your screenshot. We are required to pass to a user type custom field with a json array in string which is a little confusing :(.

Error One:

std:maniphest:tkec:dev-owner": ["PHID-USER-hl2rqmkh7x3gsiwansti"]

Correct One:

std:maniphest:tkec:dev-owner": "[\"PHID-USER-hl2rqmkh7x3gsiwansti\"]"

Anyway closing it.