Forecast Report for scheduled retirement date fall in next to next year
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 07:22 AM
Hello ,
I want to create report on scheduled retirement date for next 2 years.
We have option to select "scheduled retirement" on next year but
how to create report on "scheduled retirement" in next to next year (ie - fall in 2024).
I can select between but this will not be dynamic. Relative is also based on from current date.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 09:59 AM
Hello Deepak,
Please see the following article to address your requirements: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0749822
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:27 AM
Thanks for the reply.
I am wondering what to write in script for my requirements.
I can use "gs.endOfNextYear()" to get my start time but how to write the end time which will be "gs.endOfNextYear() + 12 Months"
answer.add('190_Next to Next year@javascript:gs.endOfNextYear()@javascript:gs.endOfNextYear() + ???', gs.getMessage('Next to Next year'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 10:42 AM
Hello Deepak,
You would have to do this conversion in a separate variable and then use it in your answer. endOfNextYear() returns a string type so we would have to convert it to a GlideDateTime to manipulate. An example would be:
var eONY = gs.endOfNextYear();
var eONNY = new GlideDateTime(eONY);
eONNY.addYears(1);
gs.print(eONY);
gs.print(eONNY);
//*** Script: 2024-01-01 07:59:59
//*** Script: 2025-01-01 07:59:59
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
--
LinkedIn