pm.execution.setNextRequest can not work in Newman

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 all,

Recently. I am using “pm.execution.setNextRequest” through postman app(version 11.2.35), but it can not work in my Jenkins pipline(Newman run).

I can’t find ANY documentation on pm.execution.setNextRequest() does anyone know anything about this?
Thanks a lot~

Hey @meringliu :wave:t2:

Welcome to the Postman Community :postman:

Is there a particular error message that you’re not seeing?

What version of Newman is that using? Is it the latest version?

Hi @danny-dainton :grinning:
Thanks for your feedback~
The error msg like " Cannot read property ‘setNextRequest’ of undefined", and I use newman as a plugin in my Jenkins CI platform. Did you mean that i need to upgrade the latest version?

I don’t know which version of Newman that your plugin is using.

It would need to be 6.1.0 or newer to use the pm.execution.setNextRequest() functionality.

I have checked my version and turns out it is 5.2.0.
After upgrade to 6.1.3 and solve the problem now~ thanks a lot~