Domain Separated Reference Qualifiers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2017 12:19 PM
While working in our domain separated instance, I've found that one of the more frustrating features is that you can't create domain specific reference qualifiers. For example, in the Configruation items reference field, Domain A would like to filter out Business Services from being included in the reference field while Domain B would like Business Service CIs to be listed. If I were to update the reference qualifier for the field while in Domain A, that change would take place globally and the business services would be filtered out from Domain B as well.
To get around this I wrote a script include that will filter the results based on what domain you're in:
var getDomainCIs = Class.create();
getDomainCIs.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getDomainCIs : function() {
if(gs.getUser().getDomainID() == 'SysID of Domain A'){
return 'sys_class_name!=cmdb_ci_service^sys_domain=javascript:gs.getUser().getDomainID()';
} else {
return 'sys_domain=javascript:gs.getUser().getDomainID()';
}
},
type: 'getDomainCIs'
});
You would then access the script include from the reference qualifier:
This is how I got around domain separated reference qualifiers. Has anyone else experienced this issue? How were you able to get around it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:44 AM
Hi Scott,
What you have done is pretty much what everyone would do. I am justr going to throw an idea that can be considered: A query BR on CMDB that will just do what this query is doing 'sys_domain=javascript:gs.getUser().getDomainID()'. It will always run on all queries made to cmdb regardless from the source. and then from all other places(BR, Ref Qual, etc) you just have to apply the query that is needed.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 07:20 PM
Scott,
I agree with Anurag, Query Business Rules are the only real way to go with this, as modifying the reference qualifier is a global operation. Query Business Rules are Domain Separated, so they will follow domain inheritance. Please be advised though, they need to be against the cmdb_ci table.
Also, a recommendation if you are dealing with CI Classes, the best way I have found to do this is to use the sys_class_path, as you can run a simple STARTSWITH GlideRecord query and easily capture extended classes.
-Brian