Determine if new comment has been added
Accepted answer
Comments
I would not expect this API to change. It has been very stable for years now. I would suggest to check the extensions for major releases however.
It is unfortunate that there is the unavoidable discouraged access, however strictly speaking any API could change and supported is only the client API that is documented in the Plain Java Client Libraries javadoc.
Having said that I have not seen any deprecation or other API change affecting my code since RTC 3.x
1 vote
One other answer
Hi Illona,
comments are not an attribute. There is an attribute name to represent them in various contexts, but there is not really an attribute representing them. Comments are a collection. The API is explained here: https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ in the comments section.
As far as I can tell you can not use comments in required attributes. After you have one already what would the semantic be?
You could try to write a custom pre-condition/advisor. Here are some examples: https://rsjazz.wordpress.com/?s=advisor&submit=Search The Approach I would try to use is to compare the old state and the new state. Get both sates and get the comments collection. Iterate the collection to look for differences e.g. compare the data available on comments. I don't know if that is going to work for you. There is only a limited amount of data available in comments to judge from.
Another approach might be a special text attribute. You could use a follow up action to copy the information from that attribute to a comment and clean it, if you want to make it mandatory again.
Just a thought.
Comments
The object that represents the comment com.ibm.team.workitem.common.model.IComment
has some attributes - creator and creationdate but I don't know what you have to expect / how the data will show in the work item save context. You will have to play with it.
You can iterate the comments and try comparing the creationdate. If that is enough and works, fine!
This is more an Eclipse question, I think. The warning is based on which packages are configured as accessible in the plugin as far as I can tell. There is no mechanism to prevent you from doing the call as of today.
Basically you are calling some unsupported API as far as i can tell. You should be aware there could be API changes.