3. Set the state to "Awaiting Change" when a Change is created from the incident using the existing "Create Normal Change" and "Create Emergency Change" UI actions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 09:42 AM
3. Set the state to "Awaiting Change" when a Change is created from the incident using the existing "Create Normal Change" and "Create Emergency Change" UI actions.
- 7,651 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-05-2023 02:34 AM
Hi, it is not working for me
I have created a choice field-"Awaiting change" in the "state" in the incident.
how to achieve this
An incident should be in a (new) state of Awaiting Change when a change record has been created from the incident record. Agents should not be able to select On Hold.
Hint: Do not delete existing state choices!
Tip: Be sure to use 'state' and not 'incident state'!
1. Disable the State choice: "On Hold".
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 state on the incident record to "Awaiting Change" when a Change is created from an incident, by updating the existing "Create Normal Change" and "Create Emergency Change" UI actions.
can anyone explain in detail?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 09:31 AM
Hi,
Here’s how you can achieve this:
Disable the "On Hold" State Choice:
- Navigate to the "On Hold" choice in the "State" field and set the "Inactive" field to true.
Add the "Awaiting Change" State Choice:
- You mentioned you have already created the "Awaiting Change" state. Ensure you have set the Value field to 4 in the sys_choice record.
Update the UI Actions:
To set the state on the incident record to "Awaiting Change" when a change is created from an incident, you need to update the "Create Normal Change" and "Create Emergency Change" UI actions.
Insert the following code just after the line
changeRequest.insert();
changeRequest.setValue("state", 4);
current.update();
- Note: Replace 4 with the actual value you set for "Awaiting Change" if it's different.
Here’s a detailed step-by-step guide for updating the UI actions:
- Go to the UI Actions section in the ServiceNow instance.
- Find and open the "Create Normal Change" UI action.
- Locate the line
changeRequest.insert();
- Directly after this line, insert:
changeRequest.setValue("state", 4); // Replace 4 with your actual value
current.update();
- Repeat the same for the "Create Emergency Change" UI action.
This should ensure that the incident state is updated to "Awaiting Change" whenever a change record is created from an incident.
Hope this helps!