- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2014 02:31 PM
I have a requirement to auto-create catalog request through email inbound action, my approach is to use the Cart API(any better solution?) in inbound action script, I set up the inbound on sc_req_item table but I am not doing a current.insert() otherwise it will double submit the request(as the order is already placed through Cart API), things working fine but one problem I don't find a way to attach the original inbound email to the Activity field, any idea?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2014 03:56 AM
Here are some ideas:
Option 1: Add Message to Comments
Inbound Action: Create Requested Item
Table: sc_req_item
Condition: <your condition here>
Script:
createRequest();
function createRequest() {
var cart = new Cart();
// add in cart
var item = cart.addItem('8c2a069c242cb800839dec45b40a7496');
// set requested for
cart.setVariable(item, 'requested_for', '5136503cc611227c0183e96598c4f706');
cart.setVariable(item, 'request_short_description', email.subject.toString());
cart.setVariable(item, 'request_description', email.body_html);
cart.setVariable(item, 'request_type', 'others');
// set application
cart.setVariable(item, 'application', '3243d574bd05300071578913764fb117');
// set assignment group
cart.setVariable(item, 'assignment_group', '4769d53099266800d7ea6843423a4c2b');
cart.setVariable(item, 'priority', 'PR3');
var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text;
cart.setVariable(item,'comments',cartmsg);
var rc = cart.placeOrder();
}
Option 2: Generate without Cart API
Inbound Action: Create Requested Item
Table: sc_req_item
Condition: <your condition here>
Script:
createRequest();
function createRequest() {
//Create Request
var grRequest = new GlideRecord ("sc_request");
grRequest.initialize();
grRequest.requested_for = '5136503cc611227c0183e96598c4f706';
grRequest.short_description = email.subject.toString();
grRequest.description = "received from: " + email.origemail + "\n\n" + email.body_text;
var requestSysId = grRequest.insert();
//Create Request Item
current.requested_for = '5136503cc611227c0183e96598c4f706';
current.short_description = email.subject.toString();
current.description = "received from: " + email.origemail + "\n\n" + email.body_text;
current.cat_item = '8c2a069c242cb800839dec45b40a7496';
current.parent = requestSysId;
current.request = requestSysId;
current.request_type = 'others';
current.application= '3243d574bd05300071578913764fb117';
current.assignment_group='4769d53099266800d7ea6843423a4c2b';
current.priority= 'PR3';
current.insert();
}
I tested Option 2 and it did work for me. I used a different Catalog Item (Dev Laptop), because I didn't have your item in my catalog, but most everything else worked the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2014 06:50 AM
Hi Ruzbehv,
Are you using Cart.() API or or one of the other methods?
Are your catalog tasks defined in your workflow or are you scripting the creation of them?
Where are you getting which group should be assigned to the catalog task assignment group, is this coming in with a catalog variable?
-e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2014 10:43 AM
Hi E,
I'm using the non cart option. My catalog tasks are defined in my workflow, which when I think about now, would be issue. Here are the options that I think would work:
1. An after business rule which would update the catalog task
2. Edit the current workflow to look for a specific "short description"
Your thoughts?
- RV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2014 11:06 AM
Hi Ruzbehv,
Can you please state the requirement for task / assignment_group?
What are you looking for to figure out what group should be assigned to task A, then task B ect...
if you do not auto-generate all your tasks when the item first attaches to the wf, then you are on the right track with the BR option. However, if you auto-generate them (or dynamically create them) you can then set you assignment up front.. Anyways, lots of ways to approach this, but it really depends on the requirement.
let me know,
-e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2014 08:56 AM
Hi E,
Now my items are being created and the workflow and sla is working however, the attachments are not passing through from the inbound email.
Any thoughts?
- RV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2014 08:51 AM
Hi Ruzbehv,
Im having the same issues as well, Were you able to resolve this?
Attachment on Inbound Actions - CART API
Thank you,.