API_INVALID_INPUT_DATA while importer cli testrun

Hello Team,

I’m new to Testiny but it looks very promising. I currently try to integrate our automated tests from Azure DevOps pipelines into Testiny testruns.

I get the following JUnit file:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="90000 Base Tests" timestamp="2024-04-04T18:21:59" hostname="build-al-c5b4" time="0.083" tests="0" failures="0" errors="0" skipped="0" total="1">
    <testcase classname="90000 Base Tests" name="TestBase" time="0.083" />
  </testsuite>
</testsuites>

This is just a first test, but in our real applications we have a ton of tests included. Anyway, the importer crashes with the following error message:

& .\testiny-importer-win.exe testrun -P prj--junit .\TestResults.xml --duplicates folder_title --enable-nested-folders --folder-separator empty --name "1.0.18042.0" --disable-custom-fields --apikey "xxxx" --close --confirm --update
 o---o  -----------------------------
   |      TESTINY IMPORTER  1.12.1
   \-o  -----------------------------

API key: user 'me@domain' in organization 'domain'
Using project: project (prj)
JUnit XML import: 1 rows
Importer will import 1 test case results to existing test run '1.0.18042.0'
JUnit XML import: 1 rows

Importer error:  Failed to execute step 0 (insert): Input data was rejected: Validation errors: Custom field value 'cf__userstory' is not valid (type=string,present=false,value=true,format=false,po=1) (API_INVALID_INPUT_DATA)

I poked around a little bit, but could not find any hint where the custom “userstory” field comes from or can be injected.

Please help.

Thank you very much.
Chris

Hi and welcome to the Testiny forum,

When you import results for a test run, Testiny will create test cases that it can link the results to. These test cases must comply with the same rules as all other test cases in the selected project, i.e. the same rules that also apply for manual test cases.

It seems you have a custom field cf__userstory in the project you are importing your results to and this field is apparently required? Can you make this field non-required or disable it completely for this project?

See the Custom Field settings: https://app.testiny.io/settings/custom-fields
…and their documentation: https://www.testiny.io/docs/settings/custom-fields/#manage-existing-and-create-new-custom-fields

Best Regards,
Alex

Thank you very much, Alex!
The project manager created the mandatory userstory field and did not tell me. Now it works!

Is there any way to supply custom fields using the cli?

Not when importing test results, sorry! The associated test cases are created with no custom fields set.