Pages

Monday, March 11, 2013

Get ProjectID and teamAreaId in Rational Team Concert Extension plugin

i use this code to get the project ID from Rational Team concert

 newState = (IWorkItem)saveParameter.getNewState();   
 IProjectAreaHandle pAreaHandle = newState.getProjectArea();   
 IAuditableCommon common = (IAuditableCommon)getService(IAuditableCommon.class);   
 IProjectArea pArea = (IProjectArea)common.resolveAuditable(pAreaHandle, ItemProfile.createFullProfile(IProjectArea.ITEM_TYPE), null);   
 String projectID = pArea.getName();   

and this one to get the teamAreaId

 ICategoryHandle ich = newState.getCategory();  
 IWorkItemCommon workItemCommon = (IWorkItemCommon)getService(IWorkItemCommon.class);  
 String teamAreaID = workItemCommon.resolveHierarchicalName(ich, monitor);  

hope this code can help the other developer that want to try to customizing Rational Team Concert. if you guys want to ask question, please drop comment or e-mail me for a faster response. thanks :)

0 comments:

Post a Comment