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.