inbound email action

shivaadapa
Tera Expert

Hi

How can i use stop processing in script part.

8 REPLIES 8

Hi @Appanna M 

It's still creating duplicate record. it's not working.

@shivaadapa ,

 

Can you tell me what is the type of the "status"? is it a boolean or string?

And also try adding a log statement inside if condition to test the event state results.

(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {


    var status = new global.RecordCreation().parseEmail(email, current.getTableName());
gs.info("Status:"+status);
     if (status == true) {
gs.info("Test");
        event.state = "stop_processing";
     }
//If the var status is string then you have to check the condition in quotes.

if(status == 'true');



})(current, event, email, logger, classifier);
 

Try and let me know the status.

Hi @Appanna M 
status is returning Boolean.
if i use stop processing in the code it will work as like default stop processing field(OOB).
my requirement is that if my inbound action will not create any record means it should go for OOB create incident and if my inbound action create any record it should not go for other actions.

Pushpanjali
Tera Contributor

@shivaadapa 

You need to add a system property "glide.hub.flow.inbound_email_trigger.show_advanced" to enable that option. Details here.

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/notification/task/deact...

Also check KB Article

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0779287

 

Please like or mark correct/Helpful based on the impact of the response.

 

Thanks & Regards,

Pushpanjali