- 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-26-2019 04:36 AM
Hi John,
You can write a script(BR Mostly) to clear out the closed field when incident is reopened. That should fix the issue.
-Anurag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2019 04:37 AM
Hi John,
if you want to change this behavior, you need to change the Business Rule mark_closed in the Incident table, especially you have to change this part of code:
if (current.closed_at.nil())
current.closed_at = gs.nowDateTime();
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-26-2019 08:20 AM
So what would the new code look like? I'm not to proficient at JS.

- 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