- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 06:54 AM
Hello everyone,
I would like to ask if someone can help in creating a report that has a condition which i'm not able to achieve with out of the box features in servicenow.
Ask is to create a report on incident table having records closed in last 3 months and have resolution note (close_notes) less than or equal to 10 characters. Being new to servicenow, I'm easily able to create a report for incidents closed in last 3 months but the other requirement for resolution note (close_notes) "less than or equal to 10 characters", I'm not able to achieve.
Can someone help me to achieve this functionality? I would be really appreciating and helping for me as a initial learner.
Thanks in advance.
Regards,
Abhishek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 09:36 AM - edited 04-05-2024 09:37 AM
Hi @abhi_b
you can use "configure function field",
Steps:
1.Create new "configure function field"
2.Once the Function is created save the report
3.Search for the function in the Filter
4.Keep the filter as shown above and run the report. Result will be displayed as shown below
Kindly mark correct and accept the solution if you find this resolves your query.
Thanks and Regards,
PP
Regards,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 07:10 AM
Hi @abhi_b ,
For your use case you can get the closed dates but counting the number of characters not possible, what you can get is :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 07:28 AM
I think you can write the script include to fetch the sysids of required incidents and call the script include in report filter condition like SysId isoneof javascript: new scriptIncludeName().getFilteredIncidents();
below is the sample script include you can use:
getFilteredIncidents: function() {
var incidentGr = new GlideRecord('incident');
incidentGr.addQuery('closed_at', '>=', gs.beginningOfLast3Months());
incidentGr.addQuery('close_notes', '!=', ''); // Exclude incidents with empty close notes
incidentGr.query();
var filteredIncidentsSysIds = [];
while (incidentGr.next()) {
var closeNotes = incidentGr.getValue('close_notes');
if (closeNotes.length <= 10) {
filteredIncidentsSysIds.push(incidentGr.getUniqueValue()); // Push sys_id of the incident
}
}
return filteredIncidentsSysIds;
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 09:36 AM - edited 04-05-2024 09:37 AM
Hi @abhi_b
you can use "configure function field",
Steps:
1.Create new "configure function field"
2.Once the Function is created save the report
3.Search for the function in the Filter
4.Keep the filter as shown above and run the report. Result will be displayed as shown below
Kindly mark correct and accept the solution if you find this resolves your query.
Thanks and Regards,
PP
Regards,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 04:10 AM
Thank you so much @Prasanna_Patil for this solution without much going to scripting part. This has helped me to create the required report which was asked to me.