This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Your BetaQ embed code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Saving state for working Create Incident inbound email action 11/21 | |
| // Note: current.opened_by is already set to the first UserID that matches the From: email address | |
| current.caller_id = gs.getUserID(); | |
| current.short_description = email.subject; | |
| current.work_notes = "received from: " + email.origemail + "\n\n" + email.body_text; | |
| current.category = "inquiry"; | |
| current.incident_state = IncidentState.NEW; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This creates a request if email subject includes "request" | |
| (function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) { | |
| // Implement email action here | |
| if (email.subject.toLowerCase().indexOf('request') >= 0) { | |
| createRequest(); | |
| } | |
| function createRequest() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gs.include('validators'); | |
| if (current.getTableName() == "incident") { | |
| var gr = current; | |
| if (email.subject.toLowerCase().indexOf("please reopen") >= 0) | |
| gr = new Incident().reopen(gr, email) || gr; | |
| gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) { | |
| gs.include('validators'); | |
| // Close if subject matches close template | |
| if (email.subject.toLowerCase().indexOf("close") >= 0) { | |
| if (String(email.subject).indexOf("INC")!=-1){ | |
| var index = String(email.subject).indexOf("INC"); | |
| var incident = String(email.subject).substring(index,index+10); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Call user | |
| var ourUser = gs.getUser(); | |
| var ourUser = ourUser.getUserByID('dfda7e034f86020058c6f0318110c7a6'); //fetched a different user, using the user_name field or sys_id on the target user record. | |
| // Show user's full name | |
| gs.print('Full Name: ' + ourUser.getFullName()); | |
| // Get user department | |
| var userDepartment = ourUser.getDepartmentID(); | |
| gs.print('DepartmentID: ' + userDepartment); // Prints Department sys_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Below gets user, department, and budget unit, | |
| Including up one parent level. | |
| Working to get parent information automatically, | |
| Versus hard-coding the dot-walk to immediate parent | |
| */ | |
| getUser('dfda7e034f86020058c6f0318110c7a6'); | |
| function getUser(userId) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var DisplayParents = Class.create(); | |
| DisplayParents.prototype = Object.extendsObject(AbstractAjaxProcessor, { | |
| initialize: function() { | |
| }, | |
| // Get user | |
| getUser: function(sys_id) { | |
| // Call user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Updates Incident record with alpha3_code returned from JSON Object | |
| function updateCountry() { | |
| current.u_alpha3_code = mycountry; | |
| current.update(); | |
| } | |
| try { | |
| var r = new sn_ws.RESTMessageV2('Country Codes Global', 'get'); | |
| r.setStringParameter("text", incident.u_country); // uses country value in request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # File: feed.py | |
| from app.home.trending import report_trending | |
| from app.home.recent import report_recent | |
| def get_feed(current_topic): | |
| '''Build unique feed from trending and recent feed sources.''' | |
| # Get posts | |
| trending_posts = report_trending(current_topic) | |
| recent_posts = report_recent(current_topic) |
OlderNewer