Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Server-Side Components/Inbound Actions/Reply HR TASK/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#Contribution 3

I want to reply from sc_task(TASK) via Out look. In sc_tasK, reply information will be auto populated in "sc_task" table custom field.

Reply Template :
Are you good to Processed ? Yes
Date : 20/10/2025

Those template info will be set in Custom fields(Good to Processed, Effective Date) in sc_task table .

By reply email inbound email action.

9 changes: 9 additions & 0 deletions Server-Side Components/Inbound Actions/Reply TASK/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Contribution 5

I want to reply from sc_task(TASK) via Out look. In sc_tasK, reply information will be auto populated in "sc_task" table custom field.

Reply Template : Are you good to Processed ? Yes Date : 20/10/2025

Those template info will be set in Custom fields(Good to Processed, Effective Date) in sc_task table after reply & task should be closed.

By reply email inbound email action.
62 changes: 62 additions & 0 deletions Server-Side Components/Inbound Actions/Reply TASK/replytask.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//Reply Inbound Email Action
// Table - sc_task

// Type - Reply
//Order - 100

// Condition - Subject - has been assigned for Satiesfiction

//Script

gs.include('validators');

if (current.getTableName() == "sc_task") {

// Update comments on current sc_task and save it
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;


// Parse Date (YYYY-MM-DD)
var DateMatch = email.body_text.match(/Date:\s*([\d]{4}-[\d]{2}-[\d]{2})/i);

var DateStr = DateMatch ? DateMatch[1] : null;

// Parse "Are you good to Processed "
var process = email.body_text.match(/Are you good to Processed\?\s*:\s*(Yes|No)/i);

var proceeStr = process ? procee.match[1].toLowerCase() : null;


if (DateStr) {
var gd = new GlideDate();
gd.setValue(DateStr);
parentCaseGR.setValue('u_date', gd); // replace with your field

}

// Update "Are you good to Process" if found
if (proceeStr) {

var normalizedInput = proceeStr.toLowerCase();

var choiceValue = null;
if (normalizedInput === 'yes') {
choiceValue = '1'; // choice value for Yes
} else if (normalizedInput === 'no') {
choiceValue = '2'; // choice value for No
}

if (choiceValue) {
parentCaseGR.setValue('u_processed', choiceValue);

}
}



}

current.state = 3;
current.update();
}

Loading