Vacation workitem generating wrongly for 1 day when created thru code
Mohanraj Palanisamy (6●1●1)
| asked Oct 16 '14, 8:30 a.m.
edited Oct 17 '14, 5:30 a.m. by Ralph Schoon (63.5k●3●36●46)
On Writing automation code to adding absence workitem( Scheduled absence workitem). If the code has start date and end date as same, It is creating absence workitem for the previous date included.
For example: if i want to create workitem for Oct 22nd then the workitem created for 21-22 which is not right. I have added the debug line for date before passed it to the function and it shows the proper value Code snippet of schedule work item getting created. ---- IResourcePlanningClient resourcePlanningClient = (IResourcePlanningClient)iTeamRepo.getClientLibrary(IResourcePlanningClient.class); ContributorAbsence absence= (ContributorAbsence)IContributorAbsence.ITEM_TYPE.createItem(); absence.setSummary(type.name()); absence.setStartDate(startDate); absence.setEndDate(endDate); absence.setContributor(engineer); // Debug statements of Date. System.out.println(absence.getStartDate()+"---"+absence.getEndDate()); try { // resourcePlanningClient.saveAbsences(new ContributorAbsence[] { absence }, new NullProgressMonitor()); } -- >> On the completion of code execution, We are able to see workitem for mentioned date and the previous one. ----- Your help is much appreciated. |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Oct 17 '14, 5:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please see: https://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/
If the start date and the end date are the same you should have one day of absence. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.