Posts

Showing posts from December, 2023

Count Number of Days

SI Function:  daysToDueDate: function(incident) {          var totalDuration;           var now = new GlideDateTime().getLocalDate();       if (!incident.dueDate.nil()) {               var dueDate = new GlideDateTime(incident.duedate).getDate();               totalDuration = new GlideDateTime.subtract(now, dueDate);               var numberofDays = parseInt(totalDuration.getNumericValue() / 86400000);               }     return nubmerOfDays; },                                             

How to Get a list field values as comma seperated

SI Function:   inAListFied: function(incident) {     var userID = gs.getUserID();     var watchList = incident.getValue('watchlist');     if (watchList) {          var arrIncident = watchList.split(",");          var ListValues = (arrIncident.indexOf(userID) >= 0);       }     return ListValues; },