Continuing the discussion from Persist environment variable automatically after updating it's value:
Programmatically update initial values from pre-request or test scripts
I tried the solution mentioned in the link above to be able to persist the current values to the initial values of environment variables programmatically. It works fine except that if I only wanted to update a subset of variables, the initial value of all the other variables that I did not want to update gets deleted.
For example, let’s say I have 10 different environment variables. In my script, I send a PUT request to the https://api.getpostman.com/environments/<environment_uid> and include only var1, var2, var3 to persist that current value to the initial values.
After the script runs, I see that the initial value of var1 to var3 gets updated correctly. But the initial value of var4 to var10 gets blanked out which is not my intention.
My question: Is there a way to do selective updating of initial values, without affecting all the other variables that I do not want to update?