This file contains 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
//Set the ITIL Role on all Groups in ServiceNow (Calgary) | |
//Run this as a Scheduled Job | |
cm_SetItilRoleToGroups(); | |
function cm_SetItilRoleToGroups(){ | |
//**** --> Change this variable to reflect the Role you want to set on All Groups <-- **** | |
var roleNameForAllGroups = 'itil'; | |
var groupCount = 0; ///How many groups |
This file contains 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
//Test Device | |
//work in progress 11/20/2013 | |
//Dependencies | |
//-- UI Action: Test Device Table: Notification Device [cmn_notif_device], Form Button, Show update (show insert?), Cond:current.isValidRecord() | |
//-- Event: cmn_notif_device.test_device | |
//-- Notification: 'Test My Device' | |
//**** Development Notes ***** | |
//Add Notification to cmn_notif_message | |
//-- Need: Notification Message,User,Device,Send Email,Send SMS |
This file contains 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
//When a user addes a certain notification to thier device, add them to a group (Group paging) | |
//Business Rule -- ServiceNow | |
//Name:addUserToGroupForNotification | |
//Table: Notification Messages [cmn_notif_message] | |
//Order: 500, When: async, Priority: 500, Insert | |
//If "P1/P2 All Manager Notify New"(sysevent_email_action). | |
//-->Then, add user(sys_user) to "IT Managers" group(sys_user_group)(sys_user_grmember) | |
cm_addUserToGroupForNotification(); |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
<!-- Start HTML --> | |
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css"></link> | |
<h1>Hello World!</h1> | |
<p class="text-danger">Danger</p> | |
<div ng-app='' class='ng-cloak container'> | |
Write some text in textbox: | |
<input type="text" ng-model="sometext" /> | |
This file contains 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
//Version 0.01 12/09/2013 | |
//ServiceNow / Fruition Partners Test Runner | |
//Supporting Class for Jasamine Test Suites | |
var JasmineHelper = Class.create(); | |
JasmineHelper.prototype = { | |
initialize: function() { | |
}, | |
getSysID: function(itemName,tableName){ |
This file contains 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
<?xml version="1.0" encoding="utf-8" ?> | |
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
<g:evaluate var="jvar_gr" object="true"> | |
var gr = new GlideRecord("incident"); | |
gr.addQuery("state","=", "2"); | |
gr.addQuery("category","=", "Sales and Service"); | |
gr.query(); | |
gr; |
This file contains 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
<mail_script> | |
template.print("<p></p>Requested items:\n"); | |
var gr = new GlideRecord("sc_req_item"); | |
gr.addQuery("request", current.sysapproval); | |
gr.query(); | |
while(gr.next()) { | |
template.print(gr.number + ": " + gr.cat_item.getDisplayValue() + ", Stage: " + gr.stage.getDisplayValue() + "\n"); | |
This file contains 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 newDate = new Date( ); | |
var unix = 1399665294; | |
newDate.setTime(unix*1000); // JavaScript is in milliseconds and unix is in seconds | |
dateString = newDate.toUTCString(); | |
gs.log("Epoch: " + dateString); |
This file contains 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 gdt = new GlideDateTime(); | |
if(gdt.getDayOfWeek() == 7){ | |
gs.log("Today is Sunday"); | |
gs.addInfoMessage("Hello World"); | |
} |
This file contains 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 sevenDays = new GlideTime();sevenDays.setValue("168:00:00");var today = new GlideDateTime(gs.nowDateTime());var dtUtil = new DateTimeUtils();var firstDay = gs.getProperty("com.snc.time_card.start_day", 7);var start = dtUtil.getWeekStart(today, firstDay);start.subtract(sevenDays);start.getDisplayValue(); |
OlderNewer