# Multi branch pipelines ENV vars

**URL:** <https://community.jenkins.io/t/multi-branch-pipelines-env-vars/7717>\
**Category:** Using Jenkins\
**Created:** [May 31, 2023, 9:06am UTC](https://community.jenkins.io/t/multi-branch-pipelines-env-vars/7717 "2023-05-31T09:06:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![riviaaaaaaaaa](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@riviaaaaaaaaa](https://community.jenkins.io/u/riviaaaaaaaaa)\
**Post date:** [May 31, 2023, 9:06am UTC](https://community.jenkins.io/t/multi-branch-pipelines-env-vars/7717/1 "2023-05-31T09:06:30Z")

</div>

I want to add env vars per my multi branch pipeline. I don’t want to add them in my code, but like terraform supports in the UI as key value pairs. There is support for credentials but these are secrets – I want to be able to add regular env vars, something like [Environment Injector](https://plugins.jenkins.io/envinject/). However, multibranch pipelines doesn’t support this plugin. Does anyone have some good suggestions?

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [May 31, 2023, 12:52pm UTC](https://community.jenkins.io/t/multi-branch-pipelines-env-vars/7717/2 "2023-05-31T12:52:04Z")

</div>

Hello @riviaaaaaaaaa ,

I’m not sure I get it.  
You want to add environment variables, but not in your code?  
What about adding some to the pipeline?

```plaintext
pipeline {
  agent any
  
  environment {
    MY_VAR = "my_value"
    BUILD_NUMBER = "${env.BRANCH_NAME}-${env.BUILD_ID}"
  }
  
  stages {
    // Define your stages here
  }
}

```

I’m not so sure I understood your request, but here is [an example](https://github.com/gounthar/MyFirstAndroidAppBuiltByJenkins/blob/2251ebd503f4a015beccff02ea89e8e6f9139b80/jenkins/controller/Jenkinsfile) where I use them.
