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 09:28 AM
Hi April, that's because you have an extra closing curly bracket. I have also modified a little bit the logic. Please take a look to it comparing it with your prior code.
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 09:37 AM
Berny thanks for sticking with me!
I updated my script with yours and getting an ERROR at line 5: Expected ')' to match '(' from line 5 and instead saw '{'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 09:40 AM
Oops. True!!! Here it goes again, now fixed
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;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 09:47 AM
If only the scripting class I'm taking in 2 weeks was 2 weeks ago I'd know what I was doing!
Here's what I got when I checked the syntax
WARNING at line 12: Expected a conditional expression and instead saw an assignment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 09:59 AM
Oh, you have the difference operators backwards