Retrieving TeamArea of workitem (e.g. defect) via Javascript
I am wondering whether it is possible to retrieve the teamarea using javascript.
My main requirement here is to retrieve the teamarea of a workitem (e.g. defect) and get it stored in a custom attribute to display it in query views.
I want to do this via using the Attribute Customization. But I fail to access "teamarea" as part of "com.ibm.team.workitem.api.common.WorkItemAttributes".
Any suggestions/hints?
Accepted answer
One other answer
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of provides a complete list of work item attribute ID's that is supported as internal attributes.
I am wondering where you might have found an attribute that represents the team area of a work item.
The reason being, that work items based on the standard template don't have an attribute that contains this information. The only information the work item has, is the category. The category implies a team area. There is a not attribute based presentation that shows the team area, but that is not actually an attribute and can not be accessed as one. The presentation is configured in the editor presentation. It is made accessible in queries and such, but it is not a real attribute.
You can access the category, but you can only get a string and JavaScript does not allow to calculate the associated team area.
So for all I can tell, what you try to do is not possible with JavaScript.
In addition, the JavaScript API does not really support complex attribute types either and is in fact very limited. See https://rsjazz.wordpress.com/2016/07/15/rtc-process-customization-what-you-can-and-cannot-do/ for some information about those limitations.
Comments
Hi Ralph,
is there another way you suggest on how we can get the "team area" displayed in query views?
PS: Our setup currently is, that the "team area" reflects a "squad".. and each squad needs to take care of a number of componentry (aka. categories/Filed against, since we are an existing product).
Our tribe has 10 squads and I want to capture a tribe view, but being able to drill down to a particular squad, I need to be able to aggregate on team areas.
What are you trying to do? When you mentioned JavaScript, I suppose you tried to do attribute customization, but now you talk about squad and tribe, which suggests reporting or querying.
The team area is available as caculated value in work item queries, but there is no pseudo attribute available to access it in the API. You have to get the category and get the mapping of that to a team area (and no, you can't do that in JavaScript either).