How to get current month in the Schedueld report Subject
This content was last updated in 2023. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017 01:50 AM
Hi,
We are scheduling reports for monthly and daily incidents.
In the subject of that scheduled report, we need to show the current date and month for Daily and Monthly reports respectively.
I am able to set the date for daily report but I am facing issues to show the Month in monthly report.
Can anyone please help me here.
For the Daily report, this is the subject I am setting:
javascript:"Daily Report of incidents - " + gs.now();
It will send the email as: Daily Report of incidents - 08-02-2017
Similarly I want subject as: Monthly Report of incidents - August.
How to implement this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:44 AM
Hi Guys,
I am also having similar requirement. I need the previous days date in the subject of a scheduled report.
Below is my code:
Script Include:
var DateReports = Class.create();
DateReports.prototype = {
initialize: function() {},
emailsubject: function() {
var gdt = new GlideDateTime();
var date = gdt.addDaysUTC(-1);
gs.addInfoMessage("testing" + date);
return date;
},
type: 'DateReports'
};
I am calling it in scheduled reports like this
javascript:DateReports().emailsubject();
I am not getting the date. Can you help me with the work around.
Thanks,
Mahesh.