Adding a variable through Jenkins

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

Hi there!

I’m trying to integrate Postman/Newman with Jenkins. Everything is working like a charm.

But there is one environmental variable that is changing for my environments a lot (let’s say it’s environment_access_token) and I wanted to use it as a parameter at Jenkins, so I could type in the environment_access_token value in Jenkins when starting the build and so Newman would use this environment_access_token variable during the test run.

Is that possible? I’m having a hard time with it. And without it it would not make sense to use CI in my situation, as I need to edit environment_access_token at Postman/at json file all the time :frowning:

TLDR: how to pass a variable and its value from Jenkins to Newman?

I’ll be much obliged for any help!

Ok, I’ve found a solution.
I’ve added string parameter to the Jenkins build, let’s say it’s called “test” and then I’ve added this to the build settings --env-var test=%test% (Windows batch command), and it’s doing its job! :slight_smile: