How to set test run custom fields when importing test report files via cli?

Hi!

We use Jenkins as our CI tool and collect test reports in junit xml files. We use the windows cli tool to upload those reports. In order to link the testruns back to the builds, we created a build url custom field within Testiny.

Is it possible to set the custom field via the cli?
If so, how?
If not, is there another solution to link the test runs back?

Best Regards,
Frank

Hi and welcome to our forum!

At the moment, custom fields can only be created for test cases (and not for test runs).

It’s currently not possible to set additional values via the CLI tool, but you can use the API.

If you would like to link back to a whole test run, you could set the “description” of a test run. The description would show up here (and can be a rich-text document) :
image

API docs to update test runs:

The request for updating the (rich-text) description for a test run would look like this:

PUT /api/v1/testrun/bulk    
[
   {
     "_etag": "<get current value or force update>" 
     "id": 9,
     "description":"{\"v\":1,\"t\":\"slate\",\"c\":[{\"t\":\"p\",\"children\":[{\"text\":\"\"},{\"t\":\"a\",\"url\":\"https://example.com\",\"children\":[{\"text\":\"example.com\"}]},{\"text\":\"\"}]}]}"
   }
]
  

Would this be a solution for your use case? Or would you like to add a link to each result/testcase in the run?

And as an additional note: we’re currently working on improving importing test reports from automated runs, so in the future you’ll have the option to add a link via the CLI.

Best regards,
Hanna