Update task through inbound action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:58 AM
Hi all,
We have inbound action on incident table to create and update incident based on conditions, now i want to update task if any Task number present email subject, through same action.
could some one help me on this
Regards,
Roopa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 06:28 AM
Hi,
you have to give type as Reply and based on your requirement give the condition, it will be some thing like below.
Please refer below link for more information.
http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 07:05 AM
Hi Roopa,
As per your question, I would suggest to approach the problem in a way to first check whether the TASK number exist in the email subject.
e.g.:
if( email.subject.indexOf('TASK') >=-1)
{
// code to update task
var taskNumber = email.subject.substr(start, length); // Please use the start point and length of task number in email subject. e.g: for TASK000001
// email.subject.substr(0, 10); if start point is beginning of email subject.
var gr= new GlideRecord('task');
gr.addQuery('number', taskNumber);
gr.query();
while(gr.next())
{
gr.comments= 'Task Updated'; // Provide your update comments here
gr.update();
}
}
else
{
// code to update incident
}
Please let me know if you need more details.
PS - Please Hit Like, Helpful or Correct based on the impact of the response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 09:19 AM
Thanks Prashant,
I was exactly looking this...
Regards,
Roopa