Close task sc_task by email inbound

ahatem
Mega Expert

Am trying to change the status of A task ticket for example ( TASK12345) from open to close completed using inbound email action.

it will be one number or more that one on the email body, how the system will trigger that and do the action that we looking for?

 

 

1 ACCEPTED SOLUTION

Ok, so target empty is expected because we are not expecting any new record to be created via this received email. 

Any how if you can give me access or we can review all your code and configuration. 

you can send me misra.ashish [at ] gmail dot com.

Thanks,

Ashish


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

26 REPLIES 26

Still didnt work, its alright, am sorry you spend to much on this. I can mark as a correct answer even it didnt work.

Queries 

are you testing this on your PDI ( personal development instance ) or client's dev instance.

The task number which you sending in email body, they are already exist in system.

The below two log messages are logging in system log

gs.log('Entering into Inbound Action - Closed Complete Task');

 

gs.log('Exiting from Inbound Action - Closed Complete Task');

 

please check my profile my contact email id is there, if you can send some meeting invite zoom,googlemeet or webex and show me what you are doing and we can resolve together.

Thanks,

Ashish

 

 

 

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

AshishKM
Kilo Patron
Kilo Patron

Hi, I tested the code and found the cause why it is not closing the task given in email body.

you can refer the below docs  how it works default.

Refer : https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/notification/concept/...

Default System has many Inbound Action configured and an inbound email action attempts to create an incident from the message. If the email has a watermark of an existing incident, an inbound email action updates the existing incident according to the action's script unless some restriction applied on default process.

I found some minor issue with our script, there are 4 places where semi colon missing.

First - Please add the semi-colon in the same line. 

find_real_file.png

Second this- system is receiving mail but not processing our Inbound Action as per our configuration then which one it is processing  - we have to find out and need to update that one so that it should not trigger by default.

I checked my PDI ... initially my code also not closing the task. You can check from sys_email log.

I found Inbound Action [ create incident ] is triggering for all my TASK closure emails and creating new Incident. We have to restrict this 'create incident' not to act on task emails.

So i updated my create incident inbound action with condition filter.

find_real_file.png

One you found the Inbound Action - which one is processing your email then open is apply the restriction.

In my case it's 'create incident' so i added a filter condition as below and my emails are working and closing the task.

find_real_file.png

 

Action Points :

  1. Add the missing semi-colon in Inbound Action script
  2. Find out which inbound action is processing your email 
  3. Apply filter condition in Inbound Action you know from step 2.

Please let me know if it works for you.

Thanks,

Ashish

Please mark correct answer and helpful for others if it works for you.


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

I did all that already, before my last email to you, as per the logs is skipped most scripts, but bellow is what am wondering about, the rest is saying skipped.

find_real_file.png

find_real_file.png

Hi, thanks for sharing.

We have find out which inbound is processing, search with "*Processed" keyword.

Also that received email is creating any target record or not, check it from sys_email table.

find_real_file.png

Thanks,

Ashish,

 

Please mark correct answer and helpful for others if it works for you.

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution