Pls let me know the correction in the correction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 07:27 AM
Hi, let me know the correction in the script as the field didnt display the value:
// Add your code here
var requestItem = new GlideRecord('sc_req_item');
requestItem.addQuery('cat_item.nameSTARTSWITHPrinter ');
requestItem.addEncodedQuery('number='+current.number);
requestItem.query();
while(requestItem.next())
{
gs.addInfoMessage(requestItem.variables.queue_name.getDisplayValue()); //this value displaying info message
current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue()); //but it didnt display into the field Queue Name.
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2022 07:40 AM
Hi Deepa,
1) Where are you running this script? Is this a background script
2) Line num 2 should be encoded query instead of add query
3) What is your requirement. It is not clear.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 03:38 AM
Hi,
Any update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2022 04:46 AM
Hi,
I created Business rule into Request Item.
The script addinfo message - display the correct value but the same value not displaying into field Queue name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 04:42 AM
Change this line
current.variables.queue_name.SetDisplayValue(requestItem.variables.queue_name.getDisplayValue());
to
current.variables.queue_name = requestItem.variables.queue_name;
But still I don't understand your business requirement.
Try the above change.
Regards,
Sumanth