Long time reader, first time asker. I have always been able to generally figure out what I need with a bit of experimentation and or the documentation.
However, I have encountered a situation where I am not able to figure it out and was hoping someone could shed some light on this with a suggestion or two.
We have two collections which effectively have the same collection variables. Problem, today someone idiot which I won’t name (John) decided that he can clear the current value of a collection variable so that he can get the “initial” value instead, since it will return that if no current value present.
Except, this brilliant genius decided to issue the command
pm.collectionVariables.clear("variable") not realizing that it will effectively WIPE the entire collection variables because there is no such method usage. One would have hoped Postman would throw an error instead of doing what he asked, incorrectly mind you, but that’s for another day.
Now the team is having a bit of an existential crisis because there has been significant updates to the collection since the last backup so restoring that is not an option. So here is my request:
- is there a way to import JUST the collection variables and not the whole thing (I’m fairly sure this is a no but I would love to be wrong)
- is there a way to copy/import the variables from the other collection into this messed up one and then just tweak the ones that are different, much easier than recreating it all again.
- any way that I haven’t thought of already above?
Now I know the collection is in JSON format so I can probably hack it by opening it and adding this block back in but I am thinking there is either a better way or perhaps that may not be the wisest approach, so figured I ask first and see what you all have for me. Any help would be appreciated.