make it simple to compare two database fields in GlideAggregate and GlideRecord queries.
Example: Just today I wanted to be able to compare the date that an incident was due to the date that the incident was actually completed (to determine how many incidents were completed on time).
Currently, in order to accomplish this I have to do one of two things -- I can either grab all the incidents and loop through them comparing them in javascript -- or I can create a new field on the table to store the value, create a business rule to fill this value on insert/update, and run a background script to populate past values.
Could/should work like:
gr.addQuery('fieldOne', '>=', 'fieldTwo');
I’m setting the status of this to “planned”
-
Greg Willis commented
Next release of 'Calgary' will have this feature.
-
AdminMatt Beran (Admin, ServiceNow) commented
yeah I end up using the second option - adding a field... Garrett, can you give an example of where you would use this? Like an example... is it for reporting or like what Russ said - to determine if something needs to be run?
-
Russ Hart commented
and to compare field values in a filter or rule condition too.. e.g. run business rule if field x >= field y