how to get currentUser and set attribute value by Java Plain API
I use RTC
firstly,I using scripts for attribute customization in work item to validate something. but i don't get current user in script. secondly,Then I refer the helloworldadvisor example and create it in local machine. example URL: https://jazz.net/library/article/495 Rational Team Concert - Creating Custom Operation Advisors add the following code into HelloWorldProhibitSave.java. IContributor iContributor = iTeamRepository.loggedInContributor() ; IContributorHandle iContributorHandle = auditableCommon.getUser(); but compile error,the following class did not find. iTeamRepository,auditableCommon how to resovle it? thirdly,if compile is ok, how to set a attribute value by java API. Thanks |
One answer
Ralph Schoon (63.3k●3●36●46)
| answered Nov 20 '13, 2:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As this is not a trivial topic, plan some time to educate yourself on this. Start here and follow the linked articles to get started on setting this up: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
Understand the differences in the APIs. E.g. the article above refers to an advisor, which basically is a client or a server side extension. These extensions usually don't use the ITeamRepository object, but you can get the loggedInUser from the AbstractService they extend. For setting attributes look into https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ and search the blog for attributes. If you are in China, where Wordpress is blocked, drop me an e-mail at ralph.schoon@de.ibm.com and I can send you some downloads of the articles. I know there are users in china who know how to get around the block as well. Comments
guoping chen
commented Nov 21 '13, 9:12 p.m.
Dear Ralph Schoon,
guoping chen
commented Nov 21 '13, 10:26 p.m.
Dear Ralph Schoon,
Most of the code is on https://rsjazz.wordpress.com/
|
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.