Requested For' in Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 08:15 AM
HI All,
Am having a similar issue here. I have a 'Requested for' field which is part of a variable set. Now when a request is submitted the requested for' in the request form is different to the 'Requested for' variable. (Hope this makes sense). So i browsed through the community site for a business rule to set this up. I applied the following
function onBefore(current, previous) {
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request', current.sys_id);
grRITM.query();
while (grRITM.next()) {
if (!JSUtil.nil(grRITM.variables.requested_for)) {
current.requested_for = grRITM.variables.requested_for;
}
}
}
which doesnt seem to be working. Can anyone help with what I could be doing missing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 08:26 AM
Hi Harish,
It is working. Please check in the below instance.
https://demo007.service-now.com/login.do
Username : admin
Password : admin
Testing steps : Catalog item : Access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 08:40 AM
Is it possible because I have set the default value of that field to populate the user name (see attached screenshot of the variable field).
I am using this variable set for other items. So i set a general default value for the field to auto populate.
Apart from this, dont see what else could stop it from working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2015 10:11 AM
I feel like I'm missing something here.
Did you try the following command?
current.requested_for = current.variables.requested_for;
(I'm assuming this is in a business rule for the request record, since requested_item does not have a requested_for field.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2015 02:21 AM
Hi Steve @ Its working now, Unable to mark Pradeep's reply as Correct Answer, as I started this as a discussion and not as a question.
But one of things we have identified (and this could be a bug) is we need to refresh the browser everytime a rule is setup. Only then does the applied change works.