Fix GlideAggregate Query and Data Retrieval for Incident Statistics #1624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: Update Incident_analysis_Resolution_Calculation_GlideAggregate.js
This update fixes the GlideAggregate query for fetching open incident statistics. Previously, the method used to retrieve the 'assigned_to' field and aggregate values was incorrect, causing issues in data retrieval and display. This commit ensures the following:
assigned_to
is retrieved usinggetDisplayValue()
instead ofget()
, ensuring proper display of user names.getAggregate()
for both 'COUNT' and 'AVG' operations to calculate the number of open incidents and average time to close.Changes:
ga.get('assigned_to')
withga.getDisplayValue('assigned_to')
to get the user display name.ga.get('result')
andga.get('result.avg_time_to_close')
toga.getAggregate('COUNT', 'number')
andga.getAggregate('AVG', 'time_to_close')
respectively.Impact:
This fix improves the accuracy of the reported incident statistics and ensures the correct data is displayed in the logs for better analysis of incident assignment and closure performance.