For the .NET agent, the Test Run id must be passed through the environment variable DT_TESTRUN_ID
(see also .NET Agent Configuration).
Using EnvInject Plugin in Jenkins you can inject the DT_TESTRUN_ID
variable between the Register Test Run
and the Execute Build
steps.