How to find all categories which belongs to a team
I have a EWM (RTC) PA with hundreds of teams and categories. Some times a team must be removed due to a company re-organization. Before I archive the team, I have to make sure that all categories which belongs to this team are either archived or mapped to any other team. Therefore I'm looking for a possibility to see all categories and only theses categories which belongs to a specific team.
How can I do that?
2 answers
You can do this via OSLC, but it'll need a couple of jumps - I wrote a little Javascript file to do it but you could do it in Python or whatever language
To get all the categories and associated team areas for a project, use the call:
https://<server>/ccm/oslc/categories?oslc_cm.query=rtc_cm:projectArea="<project area ID>" and rtc_cm:archived=false
project area ID is the ID of the project area - you can see this if you go into "Manage This Project Area"
I use Accept: application/json to fetch it as a JSON document. If you have hundreds of categories then you'll also need to pay attention to the size of the result set and potentially fetch multiple pages. Look for the oslc_cm:next entry in the response, which will give you the next page of values.
This call will return each category in the following format:
{
"rtc_cm:projectArea": {
"rdf:resource": "https:\/\/<server>\/ccm\/oslc\/projectareas\/<project area ID>"
},
"dc:description": "",
"rtc_cm:archived": false,
"rdf:resource": "https:\/\/<server>\/ccm\/resource\/itemOid\/com.ibm.team.workitem.Category\/_d_Na0M8HEeu3pbGmws67-Q",
"dc:title": "BM3 CRD",
"rtc_cm:defaultTeamArea": {
"rdf:resource": "https:\/\/<server>\/ccm\/oslc\/teamareas\/_VhBiAGE0EeuS46GN6T1p0A"
},
"rtc_cm:teamAreas": null,
"rtc_cm:hierarchicalName": "Projects - Internal\/BLah\/Blah Blah\/BM3 CRD",
"rtc_cm:depth": 3
}
"rtc_cm:projectArea": {
"rdf:resource": "https:\/\/<server>\/ccm\/oslc\/projectareas\/<project area ID>"
},
"dc:description": "",
"rtc_cm:archived": false,
"rdf:resource": "https:\/\/<server>\/ccm\/resource\/itemOid\/com.ibm.team.workitem.Category\/_d_Na0M8HEeu3pbGmws67-Q",
"dc:title": "BM3 CRD",
"rtc_cm:defaultTeamArea": {
"rdf:resource": "https:\/\/<server>\/ccm\/oslc\/teamareas\/_VhBiAGE0EeuS46GN6T1p0A"
},
"rtc_cm:teamAreas": null,
"rtc_cm:hierarchicalName": "Projects - Internal\/BLah\/Blah Blah\/BM3 CRD",
"rtc_cm:depth": 3
}
A second call on the defaultTeamArea URL will get the team area info. My code fetches the team area result and uses that in an array, and then I add the category info underneath that. I then look up the team area in the array and add it if it doesn't exist
Comments
I would write a Plain Java Client Library application that uses com.ibm.team.workitem.common.IWorkItemCommon.findCategoriesOfProcessArea(IProcessAreaHandle, ItemProfile<ICategory>, IProgressMonitor) to find the categories and to analyze whatever I need to be analyzed.
It might be possible that there are other APIs like the reportable REST API or the Foundation API that could be used.
I think the Plain Java Client Libraries would be fastest for me, because I have most experience with it.
Here available APIs: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding