- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:14 AM
Hi All,
I have to write a script for inbound email action if subject contains 3 key words like xyz, abc & pqr then the ticket will assign to the particular group. Can anyone please let me know how to do this ?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:38 AM
Hi,
Yes, that will work. One suggestion would be to convert the subject to lowercase, just incase they use ABC instead of abc...with your current script, it would miss that.
email.subject.toLowerCase().indexOf('abc') > -1 would be better.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:17 AM - edited 03-06-2023 10:17 AM
Hi,
You can use a flow (flow designer) inbound email trigger for this with the condition that the subject contains xyz or subject contains abc, etc.
Then use an update record action to set the assignment group as needed.
Try that? That method helps avoid scripting and such.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:32 AM
Hi @Allen Andreas,
We are not using the flow disigner currently, I will try as per your suggestion, however can you please let me know if the below script is correct or not?
if(email.subject.indexOf("xyz")>-1 || email.subject.indexOf("abc")>-1 || email.subject.indexOf("pqr")>-1)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:38 AM
Hi,
Yes, that will work. One suggestion would be to convert the subject to lowercase, just incase they use ABC instead of abc...with your current script, it would miss that.
email.subject.toLowerCase().indexOf('abc') > -1 would be better.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 06:54 AM
Hi @ads
Let me know if you have any other questions
If my reply above helped guide you Correctly, please also mark my reply as "Accept Solution".
Thanks and take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!