CI_JOB_STATUS as Passed with Warnings - How to pass this value to next stage via when

Scenario:
Import success, then go to deploy - Not working
Import Failed, then go to Manual Option for Rollback, then goes to deploy - Not working
Reason could be :
Allowed to failure is true in import, which means passed with warnings, so it goes to deploy,rather to manual rollback
CI Configuration file used
.gitlab-ci.yml
variables:
GIT_STRATEGY: clone
stages:

  • Import
  • Rollback
  • deploy
    Import:
    stage: Import
    script:
    • echo “$CI_JOB_STATUS”
      allow_failure: true
      Rollback:
      stage: Rollback
      script:
    • echo “$CI_JOB_STATUS”
      ######[below line is for comment/uncomment for making import failed or success]
    • ‘StatusTest.exe’
      when: manual
      needs:
  • Import
    deploy:
    stage: deploy
    script:
    - echo “$CI_JOB_STATUS”
    needs:
    - Import
    - Rollback

Further clarification needed:

  1. Needs doesnt take either of the 2 stages as it need both stages should be success or failure
  2. Passed with warning in import stage is considered as on_success, how to pass to next stage as
    when use either on_success,or on_failure or never or always as it doesnt take passed condition