Skip to content

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

Description

@krittanu-w-varisoft

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.
  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

B-bugBug: general classificationS-unverifiedStatus: Unverified by maintainer

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions