Dictionary Override - Reference Qualifier Question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello all,
Good day!!
On the Incident form, when a configuration item is selected from "Mapped Application Service" (cmdb_ci_service_discovered) class, then only their related Services has to be shown for selection in the "Service" (business_service) field, but not all services.
For this I have written a Script include, but
the problem here is, when I open the "Service" field on the dictionary level, I see there is a Dictionary Override, on the Incident. and that is oob one.
javascript:new TaskUtils().getConfigurationItemFilter(current);
Now without disturbing the existing functionality, I want to include my script include results also to this reference qualifier, like if(sys_class_name == 'cmdb_ci_service_discovered'),
My Script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Can you tell me is my script correct???
Script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Check if this helps.
But if you have already written your logic in new SI , you can put the logic in if condition and in else condition you can call the oob SI and in dictionary override you can then call your new SI. Its should work as expected i believe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Raghav,
Yes, it's working.
But can you tell me if there will be any consequences, here?
The oob Reference qualifier:
javascript:new TaskUtils().getConfigurationItemFilter(current);
I have written a script include, where when my condition matches, it gives us the results and if my condition doesn't matches then oob script include will fire.
So, I have changed the ref qualifier like below:
javascript:new Incident_cmdb_Utils().getServicesForCI(current.cmdb_ci);
If you see, in the function parameter, it is current.cmdb_ci.
But before I modify this, the oob ref qualifier is taking , only current.
So, is this ok? as I am calling oob script include if my condition not matches?
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Lucky1 It will impact the OOB one, what you need to do is pass the current object and het that as parameter in your SI function. from the current object you can get cmsb_ci valie in your script include itself.
So something like this will work:
Reference qualifier : javascript:new Incident_cmdb_Utils().getServicesForCI(current);
Script Include:
getServicesForCI : function(currObj) // current object from ref qual
{
if(currObj.cmdb_ci == ' your condition')
{
// Add your code
}
else{
new TaskUtils().getConfigurationItemFilter(currObj); // current object from ref qual
}
}
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago