- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2020 08:38 PM
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?
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2020 07:37 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 05:49 AM
Hi, this inbound action for updating [ closing ] the TASK only.
please check following things.
1) check if incoming emails are coming to ServiceNow.
how to check : check the sys_email with applied filter
2) if emails are coming , open that email and check the Email Log if it process any inbound action or not.
3) put some gs.log('Comments1'); line in script and check system log in syslog table if your gs.log comments are printing in log or not.
If it still not working let me know with screen shots.
Thanks,
Ashish
Please mark correct answer and helpful for others if it helps you.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 06:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 07:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 08:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2020 09:18 PM
Hi, Please replace the below code and test it again.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
var emailBody = email.body_text; // read the email BODY
var taskList = emailBody.split(',') // where "," is delimiter
gs.log('Entering into Inbound Action - Closed Complete Task');
for(var i=0 ; i < taskList.length ;i++){
var grTask = new GlideRecord('sc_task') // Table = sc_task
grTask.addQuery('number',taskList[i]); // get the TASK Record
grTask.addQuery('active', true) // check it task is active
grTask.query();
if(grTask.next()){
grTask.state = '3' // 3 is choice code for close completed in sys_choice table for sc_task.
grTask.update();
}
}
gs.log('Exiting from Inbound Action - Closed Complete Task');
})(current, event, email, logger, classifier);
I added two gs.print() statement in this script, please check the system log if 'Entry' & 'Exit' gs.log entry captured in system log.
Thanks,
Ashish
Please mark correct answer and helpful for others if it helps you
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution