UI Framework component error: This scope is already taken by another application
I get this error when deploying a component to an instance in my organization for the first time, but after it's been deployed to another instance (or a prior clone of the same instance).
I'm still waiting on HI to confirm the rumor, but it appears that scopes are stored somewhere outside of the instance you've deployed to. The rumor is also that a HI ticket is required to purge the scope so it can be deployed again. EDIT: HI confirmed that scopes are created in the application repository https://apprepo.service-now.com, where they can be cleaned out every time if you want (see this link). Or you can deploy to the repository mid-development and follow a convoluted release process. Better ideas below:
Here are a few other options if you get this error:
- Change the scope name in the now-ui.json file every time you deploy (this is silly, but you may want to do it this time if you're stuck on this error and you don't want to mess with XML - see option 4 if you're feeling bold)
- Export the update set created by the deployment in the first instance and first deploy that before applying any changes made to your component. This is about as silly as deploying from the repository first as HI recommends.
- Export only the sys_scope record XML. You can then import this XML to each subsequent instance to pre-create the scope prior to deploying your component. This is my method for now. If I get clever later, I may build it into a deploy script that wraps now-cli deploy. I am working on a major release with multiple components and scopes, so I created a single update set with all my scopes.
- XML manipulation option: if you really want to use the scope name you first deployed, and you don't have the original sys_scope record (say you cloned over the instance), you can export a different scope and edit the XML. I've tried it. It works. But I can't tell you if it's a good idea. Don't forget to change the sys_id to something other than what you exported.
Labels:
https://www.servicenow.com/community/developer-articles/ui-framework-component-error-this-scope-is-already-taken-by/ta-p/2313451
