what could we use in the Business Rule script similar to the client side scripting which uses g_form.getValue('o_employee'); //'o_employee' is a variable in service request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:00 AM
Hi Experts,
I have an onoload client script which calls a script include which populates the value of the variable in the service request
qrykey = 'type=keyboard^install_status=1^assigned_to='+g_form.getValue('o_employee'); //'o_employee' is a variable
// in service request
ga.addParam('sysparm_name','populateKeyboard');
ga.addParam('sysparm_table_name',"cmdb_ci_peripheral");
ga.addParam('sysparm_encoded_query', qrykey);
ga.getXMLAnswer(function(answer)
{
var str = answer.slice(0,-1);
g_form.setValue('o_asset_keyboard',str);
});
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:12 AM
Try replacing the g_form part with gs to make it read '+gs.getValue('o_employee');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:20 AM
HI,
You have to use : current.o_employee or current.getValue('o_employee ');
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:30 AM
Hi Ashutosh,
current.o_employee is a variable in the request item. It's not that value in the user table. In user table we have values like user_name and name.
Since, I have to use the script in after business Rule. will this script work??
Regards,
Raju Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2018 05:46 AM
Hi,
Then you can try to use : current.variables.o_employee if the BR is on Requested ITem.
Thanks,
Ashutosh Munot