UI Action Condition and Incident State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2018 07:43 AM
we are looking to create a new Incident State (Pending Resolution) and have specific Incident Form buttons appear/disappear in the event of this state. I created a new UI Action and utilized similar conditions that I know work. ie. current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.RESOLVED
Attempts to plug in the new State failed to work. This condition did not recognize the new State I had created. After some more digging, I found the Incident State values are determined by an OOTB Script Includes: IncidentState & IncidentStateSNC. I copid both of these Script Includes and updated to include our new State. (See image below with new state at Line 7) I was then able to successfully incorporate this into the UI Action condition and achieve desired results.
I have this sneaky suspicion that I am making this more difficult than it needs to be. Do you know of a way to simplify this process of restricting the UI Action form button based on State without the need for the expression of 'current.incident_state != IncidentState.RESOLVED'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2018 05:19 AM
Can you send a screen shot of the Incident State choice list configuration?
What was the original condition that you had written on the UI Condition definition, that did not work for you?
Also, please note that there are two state fields on the Incident table. One is "state" and the other is "incident_state". Just ensure that what ever choices you have added to incident_state field are added to state field as well.
Check the form layout to confirm, if you are displaying state or incident_state in your form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2018 06:28 AM
Hi Kevin,
If I was going to have multiple "resolve" states I would go like the "On Hold". Make a sub-state for resolve. Se the default value for what most of the cases people use and then give the ability to change it if needed. Then you can make a ui action to check if the state is resolve and the sub state is correct as well.