currently it's defined in the testcases/master/template-master.jinja2 in the following format:
{% block job_name %}{{PROJECT_NAME}}-{{OS_INFO}}-{{test_name}}-{{KERNEL_BRANCH}}-{{BUILD_NUMBER}}{% endblock job_name %}
it could be defined in the root master.jinja2 files, so that templates extends the root master.jinja2 files could use that as well.
And the test_name in the format should be job_name, and it's better to be defined in the following format:
{% block job_name %}{{PROJECT_NAME}}-{{OS_INFO}}-{{KERNEL_BRANCH}}-{{BUILD_NUMBER}}-{{job_name}}{% endblock job_name %}
that would make it easier to search job from the lava pages.