Trying to trigger catalog item (and workflow) from inbound email action

KeithM1
Tera Expert

I'm working on trying to trigger a catalog item (and the associated workflow) via an inbound email action.  I've got to where it will create the request and RITM are created but the workflow and catalog items don't get created.  Here's my 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 = '95a20ff34776301063df0923846d431d';
current.short_description = email.subject.toString();
current.description = "received from: " + email.origemail + "\n\n" + email.body_text;
current.cat_item = '570b0c4e97358d1030fd307e6253afaf';
current.parent = requestSysId;
current.request = requestSysId;
current.insert();
}

 

I've been going around in circles with this for a while now and it's making me crazy!  Any help is greatly appreciated!!

7 REPLIES 7

Logan Poynter
Mega Sage
Mega Sage

Check out the below post 

https://community.servicenow.com/community?id=community_question&sys_id=46e7f636dbfc37c8f7fca851ca96...

 

Please mark helpful/correct if this has helped you. 

 

Thanks,

Logan

Hello KeithM,

Is there anything else I can assist you with? If not, would you mind marking my reply as correct so that it shows as solved for others who may have the same question in the future.

Thanks,
Logan

The video had a lot of good information in it but still wouldn't create the catalog tasks.  I've even dummied it down to the point where all there is on the catalog item is a short description and description field.  Here's where I'm at:

I've created the inbound email flow:

find_real_file.png

Here's the action to create the Catalog Item Request

find_real_file.png

Here's the flow for the New Hire Catalog Item Request:

find_real_file.png

 

Whenever I get an email with the subject line of New Hire, it doesn't create anything.  I have no idea why.

Any help is greatly appreciated.

Hello Keith,

That looks fine. What happens if you test your flow in the top right of designer? (Note, you don't need to send a whole email, just click the + beside email record and create one on the spot as received).

Also, if you've published your flow already and sent a test email into your instance, can you locate the email in the logs and do you see where the flow executed under "Executions"?


Please mark my answer as correct/helpful if it has helped you.

Thanks,
Logan