Age field on task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 10:34 PM
Hi All ,
I want to create a field which calculates age of the open tickets on the task table . I want it on Task table so that it can be used to calculate the age of all the tickets - incident , problem ,request etc.
How this can be done ? After creating this field it has to be used for reporting on task table , means all the open tickets -incident , problem ,request etc. ( ages ) can be represented in the report.
Thanks & Regards,
Snehal Khare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:52 PM
Hi Ujjawal
This scheduled job will calculate the age only when it is run right. But if we need to calculate the age always then is it possible?
Thanks ,
Snehal Khare

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 02:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:13 PM
Please follow the below steps to achieve this:
Step-1) Create a duration field on task table.
Step-2) Add that field to all task type form (like incident, problem, catalog task etc.).
Step-3) Create UI policies to display that field on form for specific status for each form.
Step-4) Create a onload Client script using GlideAjax to calculate the duration.
Thanks,
Arindam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:35 PM
You can also write a Display business rule, But this will calculate the age when when the user opens the record.
I have created two bossiness rules one is Display(not in closed state) and other is before Update (state goes to closed).
So when ever user opens the record it will update the age which will be live data.
When ever the record is closed or resolved age will be calculated.
on dispaly
(function executeRule(current, previous /*null when async*/) {
calculateAge();
function calculateAge(){
var datedif = gs.dateDiff(current.opened_at.getDisplayValue(), gs.nowDateTime());
current.u_age = datedif;
current.update();
//gs.addInfoMessage("Age"+ datedif);
}
})(current, previous);
before update
(function executeRule(current, previous /*null when async*/) {
calculateAge();
function calculateAge(){
var datedif = gs.dateDiff(current.opened_at.getDisplayValue(), gs.nowDateTime());
current.u_age = datedif;
//gs.addInfoMessage("Age"+ datedif);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 01:43 AM
Hi Nithin,
Is it possible that we use calculated field on task table for this purpose.?
Thanks,
Snehal Khare