Name

sn_sow_req.CatalogTaskInfoSNC

Description

No description available

Script

var CatalogTaskInfoSNC = Class.create();
CatalogTaskInfoSNC.prototype = {
  initialize: function(gr) {
  	this._gr = gr;
  },
  getHeaderInfo : function() {
  	var result = {};
      result.mainHeading = gs.getMessage('Record Information');
      var userGr = new GlideRecord('sys_user');
      userGr.addActiveQuery();
      userGr.addQuery("user_name", this._gr.getDisplayValue('sys_updated_by'));
      userGr.query();
      if (userGr.next() && userGr.getValue('name'))
          result.updateMsg = gs.getMessage("Last updated by {0}", userGr.getValue('name'));
      else
          result.updateMsg = gs.getMessage("Last updated by {0}", this._gr.getDisplayValue('sys_updated_by'));
      result.updatedTime = this._gr.sys_updated_on.getDisplayValue();
      return result;
  },
  getFieldsInfo : function() {
  	//the fields we need are RITM, priority, and state
  	var fields = ['priority', 'state', 'request_item', 'assigned_to', 'assignment_group'];
  	var result = [];
  	for (var i = 0; i < fields.length; i++) {
  		if (!this._gr[fields[i]])
  			continue;
  		result.push({
  			label : this._gr[fields[i]].getLabel(),
  			value : {
  				type : 'string',
  				value : this._gr.getDisplayValue(fields[i])
  			}
  		});
  	}
  	return result;
  },
  getRecordInfo : function() {
  	var result = {};
  	result.headerInfo = this.getHeaderInfo();
  	result.fieldsInfo = this.getFieldsInfo();
  	return result;
  },
  type: 'CatalogTaskInfoSNC'
};

Sys ID

ca6cd0db45773010f877bf74562637ff

Offical Documentation

Official Docs: