Configure state choice list and behaviour
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 04:00 AM
ITSM Simulator: HELP!!
We would like state values to be updated to allow the service desk to have more information on what the next step in the process is.
1. Disable the State choice: "On Hold". (again, do not delete it)
2. Add a new State choice with the Label of : "Awaiting Change", in the sys_choice record make the Value field: 4.
3. Set the incident state to "Awaiting Change" when a Change is created from an incident, by updating the existing "Create Normal Change" and "Create Emergency Change" UI actions.
Use 'state' not 'incident_state'
- Labels:
-
Incident Management
- 4,500 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 04:56 AM
(function(current, previous, gs, action) {
var target = {};
target.table = current.getTableName();
target.sysid = current.getUniqueValue();
target.field = 'rfc';
try {
target.isWorkspace = (typeof RP == 'undefined');
}
catch (err) {
target.isWorkspace = false;
}
gs.getSession().putProperty('change_link', target);
var changeRequest = ChangeRequest.newNormal();
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.cmdb_ci);
if (changeRequest.hasValidChoice('priority', current.priority))
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
changeRequest.insert();
action.setReturnURL(current);
action.setRedirectURL(changeRequest.getGlideRecord());
})(current, previous, gs, action);
WHERE????

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2020 05:17 AM
(function(current, previous, gs, action) {
var target = {};
target.table = current.getTableName();
target.sysid = current.getUniqueValue();
target.field = 'rfc';
try {
target.isWorkspace = (typeof RP == 'undefined');
}
catch (err) {
target.isWorkspace = false;
}
gs.getSession().putProperty('change_link', target);
var changeRequest = ChangeRequest.newNormal();
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.cmdb_ci);
if (changeRequest.hasValidChoice('priority', current.priority))
changeRequest.setValue("priority", current.priority);
changeRequest.setValue("sys_domain", current.sys_domain);
changeRequest.setValue("company", current.company);
changeRequest.insert();
current.state = 4;
action.setReturnURL(current);
action.setRedirectURL(changeRequest.getGlideRecord());
})(current, previous, gs, action);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 08:14 AM
Hi gianluca5,
paste the script that Alberto Consonn provide in
current.state = 4;
changeRequest.setValue("short_description", current.short_description);
changeRequest.setValue("here");
changeRequest.setValue("description", current.description);
changeRequest.setValue("cmdb_ci", current.cmdb_ci);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 03:06 AM
Why we need to add current.state = 4; in script ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 08:24 AM
Great shortcut, thank you!