
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 09:24 AM
Hello SN Comm,
Looking for some scripting help.. I have an inbound email action that I am looking to control a little more.
as of right now, my current inbound email action is called HR Case Update. It helps control incoming emails to NOT change the state of a Case as it was doing before. It also helps control the Accept / Reject Email Notification replies to cases. We have ready but not in prod yet, an email notification that is sent to the end user once a Case worker clicks on 'Resolve Case' button, and sends the Case to 'Awaiting acceptance' state, which triggers the email notification to be sent. To allow the end user to click on one of two URL links to accept or reject the resolution to their case.
With the current inbound email action, it does not record incoming emails when the Case is in 'Closed Complete' (inactive state). I would like to see about modifying this to allow the email to still be recorded when the Case is closed.
Here below is the current inbound email script: (3 = closed completed / 20 = awaiting acceptance / 18 = work in progress)
gs.include('validators');
if (current.getTableName() == "hr_case") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
}
if(current.state !=3){
if (current.state == 20)
{
//Awaiting Acceptance
if (email.subject.indexOf("Accept") >= 0){
current.state = 3; //Close Complete
}
if (email.subject.indexOf("Reject") >= 0){
current.state = 18; // Work in Progress
}
current.update();
}
}
thanks in advance, hope someone can help out!
-Rob
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 12:14 PM
I dont see anything in the inbound that could move it back to Awaiting Acceptance. There must be a business rule, which changes back to Awaiting acceptance. If it is dev environment, you may try deactivating all the BR and try again. Note down the BR you are deactivating.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2017 01:17 PM
Great. The condition must be wrong in the Business Rule. You may need to correct that.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2023 03:12 PM
Can you share the script your speaking of?