I’m experiencing an intermittent issue where global variables become undefined in scripts after switching between workspaces, even though they’re clearly visible in the Variables tab.
Steps to reproduce:
-
Have global variables set (e.g.,
Oswith valueiOS) -
Switch from one workspace to another and back to the original
-
Run a request with a pre-request script that accesses globals
Expected behavior: Global variables should be filled.
Actual behavior:
-
console.log(pm.globals.get("Os"))outputsundefined -
The Variables tab shows the global variable with correct value
-
Issue resolves after restarting Postman
-
Only affects globals, not environment or collection variables
Environment:
-
Postman version: v11.61.2 (Just updated but had it before updating, version unknown)
-
OS: Windows 11
Workaround: Restarting the application temporarily fixes the issue.
Frequency: Intermittent - happens specifically when switching workspaces but not consistently reproducible.
Has anyone else encountered this? Any suggestions for a more permanent fix than restarting the app each time?