Skip to content

Commit b24e7f5

Browse files
InboundScript.js
1 parent 06c5594 commit b24e7f5

File tree

1 file changed

+21
-0
lines changed
  • Server-Side Components/Inbound Actions/Create Problem from Email

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
2+
// Create Problem
3+
var pro = new GlideRecord('problem');
4+
pro.initialize();
5+
pro.short_description = email.subject || "No Subject";
6+
pro.description = email.body_text || "No Description Provided";
7+
pro.caller_id = email.from;
8+
9+
// Set default values
10+
pro.category = 'hardware';
11+
pro.impact = 3;
12+
pro.urgency = 3;
13+
14+
var problemID = pro.insert();
15+
if (problemID){
16+
current.problem_id = problemID;
17+
current.update();
18+
}
19+
20+
})(current, event, email, logger, classifier);
21+

0 commit comments

Comments
 (0)