Postman word was striked out in post-response scripts

Postman version - 11.0.7-240506-1214

I have created couple of scripts a month ago like this and worked…

post-respone –

const jsonData = pm.response.json();

postman.setEnvironmentVariable(“Token”, jsonData.token.Token);

this week, I observed that ‘postman’ word was striked out…

Any info is appreciated.

Hey @docking-module-geol7 :wave:

You’re using a deprecated API here, that was actually changed many major versions ago. :thinking:

You should really be using pm.environment.set() instead of that older syntax.

Over the next couple of major versions, these older APIs and functions will stop working. Although this will still work now, I advise you to change this syntax in your scripts.

1 Like