How can I get component created datetime?
I am writting project by java plain api.
Now, I want to get created/updated datetime of a component. But I found that getCreatedDate/getUpdatedDatetime API is not existed in IComponent class. So how can I get the created datetime/updatetime of a component?
I have ever ask this question, but no answer.
Please give an advice.
|
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Sep 25 '13, 10:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
A Component implements IComponent and IAuditable.
IAuditable provides modified() for the modification date. There is no creation date I could find. IAuditable can have States (history) you can try to see if there is a state history with differnet modification times and take the first date if so. Comments
silencehill wu
commented Sep 29 '13, 12:30 p.m.
In my case, I want to remember the component created datetime and modified time.
I'm write RTC extension project
. This project need to remember changed or created component name and other information into a custom table. So I want to compare the updated datetime and created datetime of a component to make sure that the component is new or update. I can insert or update the component change into my custom table.
I want to check the component is update or created.
1
According to the JavaDoc of IAuditable you can use the IAuditable.getPredecessorState() and IAuditable.getMergePredecessorState() State recursively, to find such information.
A newly-created auditable item may or may not carry predecessor state information. Moreover, predecessor states are only retrieved when history is requested. Clients that want to see these must use
silencehill wu
commented Oct 02 '13, 6:05 a.m.
It seems need to do some source test.
I will try it.
Thks a lot. |
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.