Creating a Breakdown by Month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 08:50 AM
Hi, I am trying to create a breakdown based on picking the month from a date field on a record.
The script I am running is:
var gdt = new GlideDate();
gdt.setDisplayValue(current.vulnerability.date_published);
trimmedDate = gdt.getMonthLocalTime();
trimmedDate;
When I logged results, I could see that the month value was getting separated out:
I'm trying to match the extracted month to a manual breakdown named 'Month:
which I use for a breakdown source name 'Month':
Which is mapped to an Automated Breakdown named 'Date Published-Month':
But the data comes back with all records as unmatched for the Month. Any ideas what I am doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 08:56 AM
Hello,
Did you verified the format of the extracted month value or the configuration of the breakdown source to troubleshoot the problem:
Check the format of the trimmedDate variable and ensure that it is in the format expected by the breakdown source configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:39 PM
Hi, Tushar - Thanks for the suggestion. How do I check the format of the variable? Can I assume that since it is a date and I am using a date function that the trimmedDate variable is considered a date?
The breakdown is pulling from a manual breakdown list and those values are text.