How to access catalog variables from Business Rule Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 05:26 PM
Hello Everyone,
I have a Business Rule Script that populars a field called Requester upon a task being created
The Business rule is run on the task table.
The issues i'm having is that there is a variable on the Catalog item that the user populates called "requested for" and I need to assign its value
to my Requester field. However on the task level how do I access or dot walk to the catalog variables .
(function executeRule(current, previous /*null when async*/) {
// check to see if task is an incident
if (current.sys_class_name == 'incident')
{
current.u_requester = current.caller_id;
}
if (current.sys_class_name == 'sc_req_item')
{
if(JSUtil.notNill(current.variable_pool.requested_for)){
current.u_requester = current.variable_pool.requested_for;
}
else{
current.u_requester =current.opened_by ;
}
}
if (current.sys_class_name == 'sc_task')
{
if(JSUtil.notNill(current.variable_pool.requested_for)){
current.u_requester =current.request_item.variable_pool.requested_for;
}
else{
current.u_requester =current.request_item.opened_by ;
}
}
})(current, previous);
the bolded lines are my the ones im having problem with. Is there a way to access these variables from a business rule ? if not can does anyone have an alternative option for
populating my the requester fields based on the script above.
Edit to be clear both current.variables and current.variable_pool do not work
Thanks everyone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2024 02:00 PM
Hi Guys try:
Thx!
