How do I programmatically get creation date of work item's as month and year?
2 answers
https://www.ibm.com/developerworks/rational/library/10/creatingcustomreportswithbirtandrtc-part1/
https://www.ibm.com/developerworks/rational/library/10/creatingcustomreportswithbirtandrtc-part2/
http://www.ibm.com/developerworks/rational/library/10/creatingcustomreportswithbirtandrtc-part3/
http://www.ibm.com/developerworks/rational/library/create-custom-reports-birt-rtc/
Hi - was able to get the answer via enumes..
{
var cDate= dojo.date.stamp.fromISOString(workItem.getValue(WorkItemAttributes.CREATION_DATE));
if(!cDate)
{
cDate = new Date();
}
if (cDate.getMonth() == 0) {
return 'month.literal.l4'; // January
}
if (cDate.getMonth() == 1) {
return 'month.literal.l6'; // Feb
}
if (cDate.getMonth() == 2) {
return 'month.literal.l8';
}
if (cDate.getMonth() == 3) {
return 'month.literal.l10';
}
if (cDate.getMonth() == 4) {
return 'month.literal.l12';
}
if (cDate.getMonth() == 5) {
return 'month.literal.l14';
}
if (cDate.getMonth() == 6) {
return 'month.literal.l16';
}
if (cDate.getMonth() == 7) {
return 'month.literal.l18';
}
if (cDate.getMonth() == 8) {
return 'month.literal.l20';
}
if (cDate.getMonth() == 9) {
return 'month.literal.l22';
}
if (cDate.getMonth() == 10) {
return 'month.literal.l24';
}
if (cDate.getMonth() == 11) {
return 'month.literal.l26'; // Dec
}
return 'month.literal.l2'; //unassigned
}
sharing s it might help anyone else who search for this kind of a solution.
DK
Comments
Arne Bister
JAZZ DEVELOPER Sep 15 '16, 1:52 a.m.Hi,
can you please specify what you are trying to achieve? Do you refer to "work items" when you say specific item? For those the displayed creation date shows month and year. So I assume you mean different items.
When you want to get month and year, do you want it displayed in a particular UI or do you want to run an external script which prints this info?
Please update the header of your request to become a question (e.g. "How do I programmatically get creation date of work items as month and year?") to increase chances for more people answering.
- Arne
1 vote
Dulsanka Kulasinghe
Sep 20 '16, 8:55 a.m.Hi Aren
Thanks for your suggession, which I did change the heading.
As you understood, my requirement is to get the createtion month, creation Year of a work iteam (say incident) via the creation date of it.
My attempt is to, dispaly monthly/yearly figures on dashboard, based on that.
Thanks - Dulsanka