Multiproject pipeline - issue with predefined variable $CI_PIPELINE_IID

Hi All,

I am facing issue with predefined variable $CI_PIPELINE_IID in downstream pipeline. $CI_PIPELINE_IID is expanded to two different values one value is from upstream pipeline and another value is from current pipeline(downstream pipeline). During pipeline execution it has to take respective build numbers to download the packges of both upstream and downstream. But it is taking only current pipeline build number in both cases though i have specified to pass predefined variable $CI_PIPELINE_IID of upstream to downstream.
Upstream yml file:
variables:
WEB_PROJECT_VERSION: “${WEB_VERSION}-${WEB_PIPELINE_IID}”
WEB_PIPELINE_IID: $CI_PIPELINE_IID
stages:

  • dev

trigger-main:
stage: dev
variables:
WEB_PIPELINE_IID: $CI_PIPELINE_IID
trigger:
project: downstream project
branch: main
strategy: depend
forward:
yaml_variables: true
pipeline_variables: true
Downstream yml file:
variables:
VERSION: “2.1.0”
WEB_VERSION: “1.0.0”
API_PIPELINE_IID: “$CI_PIPELINE_IID”
PROJECT_VERSION: “${VERSION}-${API_PIPELINE_IID}”
NEW_FILE: “${CI_PROJECT_NAME}-${PROJECT_VERSION}.tar.gz”
FILE: “${WEB_PROJECT_NAME}-${WEB_PROJECT_VERSION}.tar.gz”
WEB_PROJECT_VERSION: “${WEB_VERSION}-${WEB_PIPELINE_IID}”

stages:

  • build
  • test
  • deploy

deploy-dev:
stage: deploy
variables:
DEV_VAR: “dev”
rules:
- if: ‘$CI_PIPELINE_SOURCE == “pipeline” && $DEV_VAR == “dev”’
when: always
- if: $CI_COMMIT_REF_NAME == “main”
script:
- echo $CI_PIPELINE_IID
- echo $WEB_PIPELINE_IID
- echo $NEW_FILE
- echo $FILE
- echo $PROJECT_VERSION
- echo $WEB_PROJECT_VERSION
Kindly let me know issue to fix it.