PractiTest Discussion Forum

Unable to upload required custom field

I have created custom field Browser on Run level through UI as required, now I am trying to upload browser through API as following:

{
“data”: {
“type”: “runs”,
“attributes”: {
“instance-id”: instanceID,
“exit-code”: 0,
“custom-fields”: {
“Browser”: “Chrome”
}
},
“steps”: {
“data”: [
{
“name”: “Step One”,
“expected-results”: “result111”,
“actual-results”: “actualno”,
“status”: “FAILED”
}
]
}
}
}

My response:
{
“errors”: [
{
“status”: 422,
“title”: “could not save the test results [“Custom field Browser should not be empty”]”
}
]
}

I am following example on practitest documentation, seems like my request is still incorrect, please advice how to fix it.
Thank you!

Hello Arman,
Please note, that in “custom fields” section in the attributes, you cannot write the name of the Custom Field.
What you need to write is its System ID in the following format:
“—f-XXX”: “Chrome”, where XXX is the ID of the field.
You can retrieve the ID by using this GET request if you’d like to do it automatically: Full API Documentation (Version 2) - PractiTest
Alternatively, you can retrieve it from the URL of the field’s setting page:

1 Like