Override Reference Qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2015 12:51 PM
Hi-
Background: On my Incident table I have a Reference Qualifier that auto populates the assignment group based on the CI selected. Before I made changes the default assignment group value could be overwritten and changed to a different assignment group.
I changed the Reference Qualifier to Advance with javascript: 'parent=' + current.cmdb_ci.support_group so that nowitnot only defaults the assignment group based on the CI, the lookup reference filters will only show me the children of this group so that I can refine my group (to a location based group).
What I need:
A - Need to ability to default the assignment group so that the lookup only shows thechildrengroups for the given CI - but also be able to still override the default CI with a different CI (and if that new CI has children change the lookup to show the "new" children).
B - HIDE theorginial default assignment group (use it to populate the childlookupif there are any) but need the user to SELECT an assignment group (if there are child groups) and not just go with the default assignment group.
I don't know how to write ascripto do any of this (or where you put it)....anyassistance will be greatly appreciated.
April
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 10:00 AM
Try this instead:
if(current.cmdb_ci.u_disable_auto_populate_assign != true)
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 10:18 AM
I know we are "this close"!
function u_INC_FilterAssignmentOnDisableTrigger(){
var current_source = current.cmdb_ci;
var answer = '';
if (JSUtil.notNil(current.assignment_group)){
answer = current.assignment_group;
}
if(current.cmdb_ci.u_disable_auto_populate_assign == true)
answer= ' 'parentIN' + current.assignment_group + ',' + current.cmdb_ci.support_group; //WARNING at line 10: Missing semicolon. ERROR at line 10: Expected an assignment or function call and instead saw an expression.
if(current.cmdb_ci.u_disable_auto_populate_assign =! true)
answer= 'assignment.cmdb_ci';
return answer;
}
again I can't thank you enough for continuing to help me!
April
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 10:47 AM
Hi April, you're welcome! You're still missing the fix on the difference comparison line. Here goes all the code with the fix:
function u_INC_FilterAssignmentOnDisableTrigger(){
var current_source = current.cmdb_ci;
var answer = '';
if (JSUtil.notNil(current.assignment_group)){
answer = current.assignment_group;
}
if(current.cmdb_ci.u_disable_auto_populate_assign == true)
answer= ' 'parentIN' + current.assignment_group + ',' + current.cmdb_ci.support_group;
if(current.cmdb_ci.u_disable_auto_populate_assign != true)
answer= 'assignment.cmdb_ci';
return answer;
}
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 12:03 PM
Ok finally got it to not error out:
function u_INC_FilterAssignmentOnDisableTrigger(){
var current_source = current.cmdb_ci;
var answer = '';
if (JSUtil.notNil(current.assignment_group))
{
answer = current.assignment_group;
}
if(current.cmdb_ci.u_disable_auto_populate_assign == true)
{
answer='parentIN' + 'current.assignment_group' + ',' + 'current.cmdb_ci.support_group';
}
else {
//if(current.cmdb_ci.u_disable_auto_populate_assign != true)
answer= 'assignment.cmdb_ci';
}
return answer;
}
Next STEPS:
Ok so I created an Advance Reference Qualifier javascript:u_INC_FilterAssignmentOnDisableTrigger
BUT The script is not doing what I need it to do….
If the u_disable_auto_populate_assign IS check then I DONOT want the Assignment group to auto populate the group, but rather populate the look up table with a tree view of the assignment group that is listed in the CI (this is a parent CI) and also show the children CI for that Parent. Instead it is still showing me the given assignment group for the CI and the pop up list is showing all available groups.
What am I missing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2015 06:02 AM
Hi April, I'm sorry. Somehow it appears that i missed this post. Were you able to get this resolved?