Creating a case via inbound email action

sukku
Tera Contributor

Hi All,

We have a requirement to create a case via inbound email action when from address matches user profile in user table.

Use case is like when we send a mail from our outlook to xyz shared mail box, then that shared mailbox will forward that emails to our servicenow instance. When I check in the logs of emails in servicenow Recipients is setting like xyz shared mailbox and user id column is setting it as original sender wh...

Now we want to create a case when that original sender user profile is present in user table. 

Could someone help on this usecase please.

 

Thanks and Regards,

Sukanya.

1 ACCEPTED SOLUTION

I don't think there is any such restriction as far as i know. May be there is any BR which might be checking for jpgs and restricting it. Kindly check once.

Mark the comments as helpful if they had helped to debug the issue.

View solution in original post

19 REPLIES 19

Priyanka Vasant
Tera Guru

Hi Sukku,

 

Find the similar thread that might help you.

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

Regards,

Priyanka

Hi Priyanka,

Thank you so much for your reply. I have gone thought the link which you have posted above.

In our case we have customized the case module. I have followed the above procedure and tried to incorporated with my requirement.

Please find the below script which i have written in inbound email action for creating a case.

var Userem = new GlideRecord('sys_user');
Userem.addQuery('email', email.from);
Userem.query();
if (Userem.next()) {
current.u_requestor = Userem.name;
current.short_description = email.subject;
current.description = email.body_text;
current.contact_type = "email";
current.category = 0;
current.subcategory = 0;
current.insert();
}

I have added logs in the script and logs are coming fine and it is going inside if loop. But it is not creating a case. could you please help me what is wrong in the script.

 

Regards

 

@sukku 

is it able to find that user in the if condition

can you try this

Userem.addQuery('email', email.origemail);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

With the below script also I am getting actual username wo has sent that email and i checked in the logs.

Userem.addQuery('email', email.from);

But i tried adding email.origemail also.it is giving proper user in the application logs.But case is not getting inserted.

In the email logs i have added related list and checked the logs. Please find the below screenshot.

 

find_real_file.png

Regards