It's all about the answers!

Ask a question

Retrieving TeamArea of workitem (e.g. defect) via Javascript


Guenther Jornitz (5410) | asked Oct 17 '17, 4:21 p.m.

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


permanent link
Olivier ROSET (50121) | answered Sep 30 '19, 11:40 a.m.

 You can do a workItem.getLabel("teamArea"), by example in a Calculaded Value Script;.

It worked for me (RTC 6.0.6)


Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.1k33646) | answered Oct 18 '17, 1:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 18 '17, 1:49 a.m.

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
Guenther Jornitz commented Oct 18 '17, 3:58 p.m.

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.


Donald Nong commented Oct 18 '17, 8:03 p.m.

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.


Ralph Schoon commented Oct 19 '17, 2:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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).

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.