$CI_ENVIRONMENT_SLUG is empty

Hi guys, I want to use $CI_ENVIRONMENT_SLUG in my ci, but the variable is empty. Can someone give me a hint? In the dynamic env stage it is working but for the testing stage it's empty.

Sanity Tests:
  image: maven:3.5.0-jdk-8
  stage: Tests and static code checks
  variables:
    QA_PUBLISH_URL: http://$CI_ENVIRONMENT_SLUG-publish.test.com
  script:
      - echo $QA_PUBLISH_URL
      - echo $CI_ENVIRONMENT_SLUG
      - mvn clean -Dmaven.repo.local=../../.m2/repository -B -s ../../settings.xml -P testrunner install -DExecutionID="FF_LARGE_WINDOWS10" -DRunMode="desktopLocal" -DSeleniumServerURL="https://$QA_ZALENIUM_USER:$QA_ZALENIUM_PASS@zalenium.test.com/wd/hub" -Dcucumber.options="--tags @sanity" -DJenkinsEnv="test.com" -DSeleniumSauce="No" -DBaseUrl=$QA_PUBLISH_URL