- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 06:31 AM
Dear Experts,
Greetings for the day,
We have a requirement where we have to restrict incidents to always start with the 'New' state while creating via UI.
We have implemented the following BR, but when an incident is assigned during creation, it always moves to "In Progress", how can we ensure that it always begin with 'New' state? please throw some light on this?
Note: Tested in PDI (Washington DC)
// Ensure the script only runs in an interactive session
if (gs.isInteractive()) {
// Ensure the script only runs for new records
if (current.isNewRecord()) {
// Check if the incident is assigned to an agent and the state is not 'New'
if (current.assigned_to.changes() && current.state != 'New') {
current.state = 'New';
gs.sleep(10); //Sleep for 10 milli seconds, to give enough time, so that it is recorded/captured in the activity/notes
}
}
}
Any help is appreciated.
Thank you.
Sincerely,
Shaji Kalidasan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 08:44 AM
Hi @Shaji_Kalidasan,
If I understand your requirement correctly, if you always want the State to be 'New' on Insert, you can easily edit the discussed Business Rule by unchecking the 'Insert' checkbox on the 'When to run' tab.
By unchecking this box, the Business Rule will NOT run when the Incident is created with or without an Assigned To so will therefore always be in the State of 'New'.
Please consider however, whilst the Incident will initial be created in the 'New' state when the Assigned To field is populated, any subsequent update after this will then trigger this business rule which will then update the state to 'In Progress'.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 06:43 AM
Hi @Shaji_Kalidasan,
Rather than create your own Business Rule, inactivate the existing Out Of Box Business Rule that controls this on the Incident table: Incident State Active on Assignment
(Or update and recofigure it accordingly for your needs)
See below screen shots to see how it works and why it changes. Simply uncheck the b'Active' flag/checkbox and inactivate your customer BR (Business Rule)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 08:16 AM
Hello Robbie,
Greetings for the day,
I appreciate your inputs with illustration. Is it possible to just update the activity/notes, without interfering or altering the current process, so that an incident will always be in 'New' state when it is created via UI. This is required for tracking, reporting, and audit purpose.
Thank you.
Sincerely,
Shaji Kalidasan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 08:44 AM
Hi @Shaji_Kalidasan,
If I understand your requirement correctly, if you always want the State to be 'New' on Insert, you can easily edit the discussed Business Rule by unchecking the 'Insert' checkbox on the 'When to run' tab.
By unchecking this box, the Business Rule will NOT run when the Incident is created with or without an Assigned To so will therefore always be in the State of 'New'.
Please consider however, whilst the Incident will initial be created in the 'New' state when the Assigned To field is populated, any subsequent update after this will then trigger this business rule which will then update the state to 'In Progress'.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2024 05:52 AM
Hello @Robbie,
Greetings for the day,
Thanks for your explanation and inputs. We also analyzed whether we can grey out the 'Assigned To' field while creating a new incident via the UI. Further, we need to weigh the pros and cons of this approach when incidents are created via integrations and API, even though we are mitigating it by using gs.isInteractive(). I will mark your answer as correct because the scope of my question was to make the incident always be in the 'New' state while creating via the UI. Thank you very much for your time and illustration. Have a great day.
Thank you.
Sincerely,
Shaji Kalidasan