Inbound action condition - condition to long

Lucy10
Tera Contributor

Hi,

I am facing an issue with an inbound action condition and I need help with it.

The problem is that they don't want an incident to be created depending on the context of the email body. There are certain email body contexts that they want to ignore and not create an incident for. However, the conditions required to ignore these contexts are too long to include in the condition field.

Should I create a system property that contains the two long values separated by a comma? And how should I include this system property in the condition?

Any advice and examples would be greatly appreciated.

Thanks,

Lucy

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Honestly, I havent used a property - attempted to test it now, looks it should be fine but havent tested it as on PDI. I used these 2 approaches though:

1) I put the conditioning in the Action function with Return; if it doesnt match

2) I open the sys dictionary of the field Condition in the form - I simply increase it's lenght.

 

1:

JoroKlifov1_2-1709224623452.png

 

 

2:

JoroKlifov1_3-1709224717289.png

 

JoroKlifov1_0-1709224310706.png

 

Hope this helps! 

 

Cheers,

Joro

 

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Honestly, I havent used a property - attempted to test it now, looks it should be fine but havent tested it as on PDI. I used these 2 approaches though:

1) I put the conditioning in the Action function with Return; if it doesnt match

2) I open the sys dictionary of the field Condition in the form - I simply increase it's lenght.

 

1:

JoroKlifov1_2-1709224623452.png

 

 

2:

JoroKlifov1_3-1709224717289.png

 

JoroKlifov1_0-1709224310706.png

 

Hope this helps! 

 

Cheers,

Joro

 

Community Alums
Not applicable

JoroKlifov1_1-1709224601438.png

 

Sohithanjan G
Kilo Sage

Hi @Lucy10 , 

 

There are two approaches here:

 

1. You can use create a system property where you can store the lengthy values. You can do this by navigating to System Properties > All in the ServiceNow instance and then clicking on New. Give your property a name and provide the necessary values.

 

email.body_text.contains(gs.getProperty('your_system_property_name'))

 

2. If you reach the max character limit,  you can simply call that in the condition field via:

new scriptIncludeName().functionName(email.body_text);

And then you return true or false from the script include where you're evaluating this.

 

Please consider marking my reply as Helpful and/or Accept as Solution, Thanks!! 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

Robbie
Kilo Patron
Kilo Patron

Hi @Lucy10,

 

The best way to handle this would be via a Script Include which you call from within the condition.

I've attached a screenshot of how ServiceNow handles this with a baseline Inbound Action for CSM (Case records)

 

Within the condition you call the Script Include as follows:

(The Script Include is called 'CSEMailUtil' and the method to handle this is called 'checkCaseConfigPrefix')

 

new CSEMailUtil.checkCaseConfigPrefix(email.subject)

 

Screenshot 2024-02-29 at 16.34.09.png

 

Here's also another community link where it's explained if you require more info:

https://www.servicenow.com/community/developer-forum/inbound-action-condition-to-call-script-include...

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie