business_rules
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| business_rules [2024/12/13 09:58] – johnsonjohn | business_rules [2024/12/13 10:04] (current) – johnsonjohn | ||
|---|---|---|---|
| Line 127: | Line 127: | ||
| })(current, previous); | })(current, previous); | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | =====INCIDENT-Display Caller Email is Empty===== | ||
| + | < | ||
| + | (function executeRule(current, | ||
| + | |||
| + | var callerName = current.caller_id.name; | ||
| + | gs.addInfoMessage(' | ||
| + | |||
| + | })(current, previous); | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | =====True Up NonState Values from Parent INC===== | ||
| + | < | ||
| + | (function executeRule(current, | ||
| + | |||
| + | // Add your code here | ||
| + | var sysID = current.sys_id; | ||
| + | |||
| + | //Check for any child incidents | ||
| + | var childCheck = new GlideRecord(' | ||
| + | childCheck.addQuery(' | ||
| + | // | ||
| + | childCheck.query(); | ||
| + | |||
| + | if (childCheck.hasNext()) { | ||
| + | while (childCheck.next()) { | ||
| + | // If child incident is already Closed or Cancelled, child incident should not be updated | ||
| + | if (childCheck.incident_state == IncidentState.CLOSED || childCheck.incident_state == IncidentState.CANCELED) | ||
| + | return; | ||
| + | |||
| + | // Update child incident' | ||
| + | childCheck.category = current.category; | ||
| + | childCheck.subcategory = current.subcategory; | ||
| + | |||
| + | // Only copy parent incident' | ||
| + | if (!current.assignment_group.nil()) { | ||
| + | childCheck.assigned_to = ''; | ||
| + | childCheck.assignment_group = current.assignment_group; | ||
| + | } | ||
| + | |||
| + | // Only copy parent incident' | ||
| + | if (!current.assigned_to.nil()) { | ||
| + | childCheck.assigned_to = current.assigned_to; | ||
| + | } | ||
| + | |||
| + | childCheck.setWorkFlow(false); | ||
| + | childCheck.update(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | })(current, previous); | ||
| + | |||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | =====Sys_USER-Add VIP Mark===== | ||
| + | < | ||
| + | (function executeRule(current, | ||
| + | |||
| + | //Query sys_user Table and Add VIP Mark | ||
| + | var gr = new GlideRecord(' | ||
| + | gr.addQuery(' | ||
| + | gr.query(); | ||
| + | |||
| + | while (gr.next()) { | ||
| + | gr.vip = true; | ||
| + | gr.setWorkflow(false); | ||
| + | gr.update(); | ||
| + | } | ||
| + | |||
| + | })(current, previous); | ||
| </ | </ | ||
| ---- | ---- | ||
business_rules.1734112738.txt.gz · Last modified: by johnsonjohn
