How to extend the precondtion that validate the owner doesn't belong to team area before save workitem on RTC
We use RTC4.0.6 version.
Where can I find this API?
Has any example like it?
please help me ! Thank you very much!
Accepted answer
There are various examples for this kind of API on https://rsjazz.wordpress.com/ most of the posts there are based on examples on Jazz.net https://rsjazz.wordpress.com/interesting-links/ for more. For development you should look into https://jazz.net/library/article/1000. Currently that works only for RTC 4.0. It is in the progress of being updated to make it usable for other RTC versions. I am not sure however, when we will get it on the web site.
https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ contains common API you would be interested in.
Most examples on the blog are follow up actions. The difference between an advisor and a follow up action is the extension point as described in https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/
Good luck.
Comments
Thank you Ralph,I will try to read the examples on rsjazz.wordpress.com .
Hi,Ralph. I don' t find the API: which team area does the owner belong to on workitem?
Chen, the team area the work item belongs to can be found using the category.
To understand what team area and what role a user has, have a look at https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ the method SampleCurrentUserHasRoleCondition can give you some hints. Also interesting API (but client API) is described in https://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/ . To understand what you are up to if you want to do this, start reading here: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
Not sure right now, if using permissions would be easier. If the user is not member of the team area, what role does he have? Prevent "Everyone" from saving the work item?
I would try that first. I am currently not completely sure if users that are member of the project or parent project areas have. See https://jazz.net/library/article/291
Hi Ralph,on fact I want to make these warning message to the error message ,prevent the user save the work item if appear this error message , I have to extend the procondition?
This has nothing to do with a precondition. I am not sure how this is implemented. It might be a validator. I think it is built in and not configurable. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization to understand validators. JavaScript however would not allow you to do this either, due to its API limitations. An option would possibly be a java based validator as described in https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ . This would work for the Web UI and the Eclipse UI. An advisor/precondition would only prevent the save and not show an error.
Permissions would also just prevent the save.
Thank you for Ralph's answer . you mention the suggest "Permissions would also just prevent the save." it see https://jazz.net/library/article/291 ?
Have you opened the link? It describes how permissions work.
Hi Ralph, I can open the link. I readed this article ,but I don't what can I ?
I am not aware of any way to achieve the change you desire - making the warning an error in the display. There are only the following ways I am aware:
- Use permissions - only users with certain roles in the team area (which requires to be member of the team, except for the Everyone role)
-
Extend RTC with a Java based validator that checks the condition and returns the error AND using the operational behavior Attribute Validation (should give you exactly what you ask for) - I checked and the mechanism above showing the icon
- Extend RTC and create an advisor/precondition that prevents saving
What you see above is configured this way:
and shows in the presentation editor like this:
And I am not aware you can change this to error.