- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 04:32 AM
When I cancelled an incident it marks the Closed field at 11/26/2019.
So if I reopen that incident the Closed info is still showing 11/26/2019 and when I actually close out the incident it will still show the same 11/26/2019. So now if managers what to run reports on that the time and dates will not be correct. So how do I get it to where when it's cancelled the Closed field is not populated?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 11:03 PM
Try with this code:
if (current.closed_at.nil() && current.incident_state == IncidentState.CLOSED)
current.closed_at = gs.nowDateTime();
Basically it will populated the Closed date/time field only in case of Incident closure and NOT in case of Incident cancellation.
If I have answered your question, please mark my response as correct and/or helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 04:45 AM
Updated the code and when I cancelled and set to closed the close field was populate with the time I cancel the incident.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 06:08 AM
Just tested it in my personal instance, in addition to the change done in the Business Rule mark_closed, you have to comment the line 3 and 4 in the Business Rule Set Closure Fields of the Task table:
In this way, it will populate the Closed date/time field ONLY for the Incidents in state Closed and NOT for the Canceled.
If I have answered your question, please mark my response as correct and/or helpful.
Thank you very much
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 09:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2019 10:44 AM
Exactly, it will populate the time and date only when the Incident will be closed.
Glade to help you!
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 04:48 AM
Why are you reopening a cancelled incident? Closed and cancelled incidents shouldn't be reopened, new incidents should be created and linked back to preceding one if necessary.