Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using Custom Operation Advisor(custom precondition) to check if workitem's time tracking could be saved.

Imagine following case for RTC 3.0.1:

A user enters his progress in hours for a particular work item in the time tracking tab.
I should prohibit him to save this data if he enters it in some invalid time periods (i.e. before 01.01.2013).

The idea was to develop a plugin that would implement custom precondition for the save operation. This plugin could have asked an external service for invalid time periods.

The problem: I don't know how could my plugin get the data entered by a user in the time tracking tab.

0 votes


Accepted answer

Permanent link
I searched the API for ITimeSheetEntry and figured it is managed as a reference. See the client code below. So you would look into the new references of the new state.

	
		ITimeSheetEntry entry= workItemClient.createTimeSheetEntry(fgProjectArea);
		entry.setStartDate(now);
		entry.setTimeSpent(twoHours);
		entry.setTimeCodeId(timeCodeId);
		entry.setTimeCode(timeCodeLabel);
		entry.setWorkType(workType);
		
		references.add(WorkItemEndPoints.WORK_TIME, IReferenceFactory.INSTANCE.createReferenceToItem(entry));
		workingCopy.getDependentItems().add(entry);

Aliaksei Gizheuski selected this answer as the correct answer

1 vote

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Feb 12 '13, 8:48 a.m.

Question was seen: 4,504 times

Last updated: Feb 12 '13, 11:13 a.m.

Confirmation Cancel Confirm