Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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?


0 votes


Accepted answer

Permanent link

 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

0 votes


One other answer

Permanent link

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.
 

0 votes

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

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,944

Question asked: Oct 17 '17, 4:21 p.m.

Question was seen: 2,495 times

Last updated: Sep 30 '19, 11:40 a.m.

Confirmation Cancel Confirm