insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Scirpt insomnia.globals.set(,) not set variable when use base global environment

Open krittanu-w-varisoft opened this issue 6 months ago • 2 comments

Expected Behavior

when using base global environment in script insomnia.globals.set("global", "abc123") variable name global must set to value "abc123" like collection variable like this Image

Actual Behavior

global variable not exist

Reproduction Steps

  1. create new collection
  2. create global environment and use them

Image

  1. create new request GET https://example.com
  2. set after request
insomnia.globals.set("pre-global", "abc123")

Image

  1. send request 6.check global environment

Image

Is there an existing issue for this?

Which sync method do you use?

  • [ ] Git sync.
  • [x] Insomnia Cloud sync.
  • [ ] Local only

Additional Information

this work in 11.1.0 but not in 11.2.0

my full test script is

insomnia.globals.set("global", "abc123")
insomnia.baseGlobals.set("base-global", "abc123")
insomnia.environment.set("env", "abc123")
insomnia.baseEnvironment.set("base-env", "abc123")

the environment work fine in both case

this happen in pre-request and after-request

current work around is create "sub" globel environment to allow command to set variable to.

Insomnia Version

11.2.0

What operating system are you using?

Windows

Operating System Version

Windows 11 24H2

Installation method

download from insomnia.rest

Last Known Working Insomnia version

11.1.0

krittanu-w-varisoft avatar Jun 09 '25 06:06 krittanu-w-varisoft

it is also happening to me, just test it, deleted the current value of a "sessionId" I used to fill during a login call and the value today is never updated.

marcuss-grindr avatar Jun 09 '25 17:06 marcuss-grindr

Same issue after updating to 11.2.0

talhak55 avatar Jun 11 '25 10:06 talhak55

Fix in https://github.com/Kong/insomnia/pull/8790 which will be available in V11.3

cwangsmv avatar Jun 19 '25 07:06 cwangsmv