Name
global.ProblemState
Description
Problem State constants, use these constants when determining which Problem State to use. Example - is the Problem in the Resolved state var problemGr = new GlideRecord( sn_problem_v2_problem ); if (problemGr.get( sys_id ) && problemGr.state == ProblemState.RESOLVED) // do something when the incident is resolved Example 3 - how to use this on the client var ga = new GlideAjax( ProblemState ); ga.addParam( sysparm_name , getProblemState ); ga.getXMLAnswer(function(answer) { var problemState = JSON.parse(answer); g_form.setValue( state , problemState.NEW); });
Script
var ProblemState = Class.create();
ProblemState.STATES = {
NEW : ProblemStateSNC.NEW,
ASSESS : ProblemStateSNC.ASSESS,
ROOT_CAUSE_ANALYSIS : ProblemStateSNC.ROOT_CAUSE_ANALYSIS,
FIX_IN_PROGRESS : ProblemStateSNC.FIX_IN_PROGRESS,
RESOLVED : ProblemStateSNC.RESOLVED,
CLOSED : ProblemStateSNC.CLOSED
};
ProblemState.RESOLUTION_CODES = ProblemStateSNC.RESOLUTION_CODES;
ProblemState.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getProblemState: function() {
return ProblemState.STATES;
},
getResolutionCodes: function() {
return ProblemState.RESOLUTION_CODES;
},
type: 'ProblemState'
});
Sys ID
91d5739b875b13000e3dd61e36cb0b7f