Update scope for multiple Library Variables

We have many library set variables that are scoped to environments i.e.(QA,DEV). We are trying to update all of them to add a new environments to their scope (QA,DEV,UAT). Since we have so many this manual process takes for ever. Is there an easy way to find variables that are scope to (QA,DEV) and update their scope to (QA,DEV,UAT) ?

Hi @djeantine,

Thanks for getting in touch! The easiest way to make bulk updates like this would be via an API script. I don’t see any existing sample scripts that do exactly this against a library variable set, however the following might give you a good starting point. This should give you the ability to find and modify any project variables that are scoped to your 2 environments and update all their scopes to include the third (UAT).

As with running any API scripts I’d recommend taking a database backup first, or test this against a test instance first so as not to include any potential unexpected changes to your live instance, especially when there are a large number you’re expecting to modify.

I hope this helps, and please let us know if you have any questions or concerns going forward.

Best regards,

Kenny

1 Like

Thank you much for your help. I will go ahead and use this code.

Cheers,

1 Like