Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var rec = new GlideRecord('case'); // any table which you want to use
rec.addEncodedQuery('stateNOT IN60,40, 20'); // filtering out all the closed/cancelled cases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Active = true or addActiveQuery is better. If you want to stick with this, explain in the comment what states 60, 40, 20 are exactly.

rec.query();
while (rec.next()) {
var openedDate = new GlideDateTime(rec.opened_at.getDisplayValue());
var dur = GlideDateTime.subtract(openedDate,actualDateTime );
//gs.info("dur"+dur.getNumericValue()) ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out logs or explain if users can add it back in to add functionality.

elapsedTime = dur.getNumericValue()/86400000 ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a defined variable. Define it first.

// gs.info ("elapsedTime" + elapsedTime)
// Check to see when the item was created
if (elapsedTime <= 2) aging = '0-2 Days';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aging is not defined anywhere. Declare it before setting it's value.

if (elapsedTime > 2) aging = '3-4 Days';
if (elapsedTime > 4) aging = '5-7 Days';
if (elapsedTime > 7) aging = '8-15 Days';
if (elapsedTime > 15) aging = '16-30 Days';
if (elapsedTime > 30) aging = '31-60 Days';
if (elapsedTime > 60) aging = '61-90 Days';
if (elapsedTime > 90) aging = 'Over 90 Days';

rec.setWorkflow(false); // Skip any Business Rules
rec.autoSysFields(false); // Do not update system fields
rec.aging_category = aging;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aging is not defined anywhere. Declare it before using it.

rec.update();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Find out all the cases with the difference in their create date and current date and put them in different buckets of their age. Then you can report on the aging. With this you will be able to run the Bucket Group reporting on tables without using PA.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit of these buckets? Why not create a report on the Case SLA for example?

Loading