- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 03:53 AM
Hello!
I am trying to set some fixed values in reference fields like assignment group, location, primary configuration item. Our requirement is when incident tickets are generated from Dynatrace Integration, assignment group, location and CI should have the values X,Y and Z auto set. I tried using onLoad client script to set up these values, but it didn't work as expected. The onLoad script would work only after opening the tickets, hence I thought of using Before Business Rule.
We cannot set these values in Integration script itself because of some other requirement conflicts.
Here is my script:
(function executeRule(current, previous /*null when async*/) {
current.contact_type = "X";
current.location = "Y";
current.assignment_group = "Z";
current.update();
})(current, previous);
Any help would be highly appreciated!
Thanks,
Su
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 04:24 AM
Do you have group by name Z in your sys_user_group table. Please pass the exact name of group. Write before insert/update BR.
EX: Network is a group name
current.assignment_group.setDisplayValue('Network');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 03:58 AM
Use
current.setValue('assignment_group','Z');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 04:04 AM
Hi,
If your fields are Refere fields then try using below code,
(function executeRule(current, previous /*null when async*/) {
current.contact_type = "X";
current.location.setDisplayValue("Y");
current.assignment_group.setDisplayValue("Z");
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 04:07 AM
As you are setting values to the reference field make sure X,Y and Z values in your business rule should be sys_id's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 04:14 AM
Something like this?
current.setValue('assignment_group','sys_id of group');