diff --git a/Server-Side Components/Inbound Actions/Reply HR TASK/README.md b/Server-Side Components/Inbound Actions/Reply HR TASK/README.md new file mode 100644 index 0000000000..365a3619c1 --- /dev/null +++ b/Server-Side Components/Inbound Actions/Reply HR TASK/README.md @@ -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. + diff --git a/Server-Side Components/Inbound Actions/Reply TASK/README.md b/Server-Side Components/Inbound Actions/Reply TASK/README.md new file mode 100644 index 0000000000..409f186e3c --- /dev/null +++ b/Server-Side Components/Inbound Actions/Reply TASK/README.md @@ -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. diff --git a/Server-Side Components/Inbound Actions/Reply TASK/replytask.js b/Server-Side Components/Inbound Actions/Reply TASK/replytask.js new file mode 100644 index 0000000000..e173e1f0af --- /dev/null +++ b/Server-Side Components/Inbound Actions/Reply TASK/replytask.js @@ -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(); +} +