Reputation: 311
I am working an automation for IBM Rational Team Concert (IBM aka Jazz RTC).
The java/groovy script receives the project area name and needs to retrieve information about the project area, represented by an IProjectArea
instance.
Which are the required API calls? Apparently, there is no such query available in the API.
Upvotes: 1
Views: 716
Reputation: 311
The API was not designed to search for project areas. Fortunately, there is the IProcessClientService.findProcessArea(URI areaURI, Collection properties, IProgressMonitor monitor)
method:
ITeamRepository.getClientLibrary(IProcessClientService)
to get a IProcessClientService
instance.IProcessClientService.findProcessArea(URI areaURI, Collection properties, IProgressMonitor monitor)
.
areaURI
is the project area name, 'encoded as URI' (can't explain why, it is internally converted back to string). I had to URL encode de name, but assuring that white-space is encoded as %20
instead of +
which would be the encoding standard.properties
collection. Works with null.IProcessArea
instance and not IProcessAreaInstance
as I first expected by comparing with similar API methods. Therefore, no 'fetch' is needed.IProjectArea findProjectAreaByName(String name) {
def processClient = repositoty.getClientLibrary(IProcessClientService) as IProcessClientService
def uri = URI.create(URLEncoder.encode(name, "UTF-8").replace('+','%20'))
return processClient.findProcessArea(uri, null, null) as IProjectArea
}
Upvotes: 1