- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 12:09 AM
Hi All....on incident form i have to create a new field called "Last Resolved' on the Incident page which should capture the date when the Incident was last marked as resolved. Please help me in this.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 12:23 AM
Hi Manisha,
one quick question.
why do you need to capture the date in your last resolved field.
there is OOTB field "closed" you can use that field also to update the exact resolved time of your incident.
just you need to mention the condition in business rule.
current.closed_at = gs.nowDateTime();
below screenshot for your Resolved At field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 12:31 AM
Hi Manisha,
Please create a new business rule (before)
condition -->> current.incident_state == IncidentState.RESOLVED || current.incident_state == IncidentState.CLOSED
script -->
function onBefore(current, previous) {
if (current.fieldname.nil())
current.fieldname= gs.nowDateTime();
}
The above script captures the resolved time when ever the incident is resolved.
and it also takes care of incidents which are directly closed by adding the closed time to resolved field.
Please like or mark correct based on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 01:35 AM
Thank you so much....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 01:35 AM
Thank you so much....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 12:49 AM
Hi Maneesha,
Just write a business rule(Insert and Update) on that table and select 'advanced' and write the following script.
(function executeRule(current, previous) {
if(current.state==numofResovedState)
{
current.Fieldname=new GlideDateTime().getDisplayValue();//setting the resoved time to that field
}
})(current, previous);
And make that field 'read-only' in dictionary option..so that the resolved time field can not be editable.
Pls mark Correct and helpful...If the answer fufills ur need.
Thanks
Gangaprathap Yadav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2017 02:45 AM
Hi Pratap,
Thank you so much. it worked for me..I need only Date not time. How can i do that one.?