SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var SPOC_TicketUtils = Class.create();
  2. SPOC_TicketUtils.prototype = {
  3.     initialize: function() {
  4.     },
  5.    
  6.     hasCapacity: function(assignee, addedCapacity) {
  7.          
  8.         var ticket = new GlideRecord('u_ticket');
  9.         ticket.addQuery('state', 'IN', '1,2,-5');
  10.         ticket.addQuery('assigned_to', assignee.toString());
  11.         ticket.query();
  12.        
  13.         var capacity = 0;
  14.         while(ticket.next()){
  15.            
  16.             capacity += ticket.u_capacity;
  17.         }
  18.        
  19.         if(capacity + addedCapacity > 100)
  20.             return false;
  21.        
  22.         return true;
  23.         },
  24.         type: 'SPOC_TicketUtils'
  25.     };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top