Skip to content

Commit e2bcf76

Browse files
authored
Calculate ticket age (ServiceNowDevProgram#744)
* Create script.js in ticket age * Create readme.md in ticket age
1 parent cc3ab0f commit e2bcf76

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This is a custom action that calculate the age of the ticket/incident on the basis of its created date which is started date and the date at which it is updated.
2+
3+
4+
Input Variable:
5+
6+
1. Start Date Type-Date/Time, Mandatory
7+
2. End Date Type-Date/Time, Mandatory
8+
9+
Output variable:
10+
1. Ticket Age Type-string
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(function execute(inputs, outputs) {
2+
var start_date = new GlideDateTime(inputs.start_date); //created date
3+
var end_date = new GlideDateTime(inputs.end_date); //updated
4+
outputs.ticket_age = GlideDateTime.subtract(start_date,end_date).getDisplayValue();
5+
})(inputs, outputs);

0 commit comments

Comments
 (0)