You may have faced the situation that you have a requirements model imported from an external sources like DNG, Windchill or Codebeamer but the original was branched or simply moved to a different location or server. Now you have to "switch" your medini model to that new location. A new import is no option because you loose all traces.
There are appropriate Switch actions available for Integrity/Windchill and DNG but not for Codebeamer. To overcome that situation, a script may do the job. I have attached a script that does the necessary steps. It basically assumes that you have two models imported from Codebeamer, the original model from the old tracker and the new target from the new tracker. The script now iterates over all requirements in the original and finds a match in the new one, then replacing internal meta-data of the original to actually reference the new match. Once done, the imported new target can be deleted and the original model just need to be updated (pulled). If everything goes right, the pull now synchronizes with the new tracker and not the old one anymore. There are further instructions inside the script.
Note that the "annotation.js" lib has to be present as well, and in a ".lib" subfolder as usual. The script was developed with 2024 R2 but should run on older versions as well.
Happy Scripting
Jan