- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 02:59 AM
Hello,
So I am writing a Before Insert Business Rule on the Request_Item Table
So if a user updates the Customer Visible notes on the Request Item it creates a new Chat Queue Entry:
Script:
if(ourUser.hasRole('role_name')) {
var gr = new GlideRecord('chat_queue_entry'); //Stores user requests for live support. Extends Task [task]
gr.initialize();
gr.queue = queue;
gr.action = 'waiting';
gr.short_description = myNumber +": " + comments;
gr.group = user_display_name +', ' + "Service Desk";
gr.active = true;
gr.insert();
}
it does the insert fine but I am trying to find how I can store the "Number" i.e. CHAT0012806 into a variable after the insert.
Would I need to do a table query afterward?
Any help would be appreciated
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 03:07 AM
After insert try this:
gs.addInfoMessage("A new chat queue has been created for you with number: "+gr.number);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 03:07 AM
After insert try this:
gs.addInfoMessage("A new chat queue has been created for you with number: "+gr.number);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 03:16 AM
I don't know why I didn't think of that, I just add "var chat_queue_entry = gr.number" after the insert
Thanks for the quick reply.