Get and Set Job Run Number
To help you distinguish one job run from another, Automation assigns a number to every run. By default, the number is auto-incremented starting from 0 and is not unique (there can be two or more runs with the same number).
The run number is shown next to each job run on the project Jobs page.
Get the current job run number
Sometimes, you might need to get the current run number right from the automation script. For example, to generate a version number for the application you develop. You can do this either using the JB_SPACE_EXECUTION_NUMBER
variable or the executionNumber()
API function:
Set the next run number
Setting the exact job run number might be helpful in some cases. For example, when you want to reset the run counter.
Open the required project.
On the project sidebar menu, choose Jobs.
Open the required job by clicking its title.
Click the menu icon in the top right corner and choose Change the next job number.
In the opened window, specify the desired value. The next job run will get the specified number.