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

How to get IQueryableAttribute for Team area ?

Hello team

I am trying to create the query using query expressions .
I could able to query the project area ,type and planned for using below code ,But i am unable to query the team area using query expression ??

Could you please suggest .

 IQueryableAttribute projectAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE)
                        .findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableCommon, monitor);
                IQueryableAttribute typeAttibute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea,
                        IWorkItem.TYPE_PROPERTY, auditableCommon, monitor);
                IQueryableAttribute plannedForAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea,IWorkItem.TARGET_PROPERTY, auditableCommon, monitor);
               IQueryableAttribute teamAttribute = QueryableAttributes.getFactory(ITeamArea.ITEM_TYPE).findAttribute(projectArea,ITeamArea.TEAM_DATA_PROPERTY_ID,auditableCommon, monitor);

              
                // Creating an Expression
                Expression projectAreaExp = new AttributeExpression(projectAttribute, AttributeOperation.EQUALS, projectArea);
                Expression storytypeExp = new AttributeExpression(typeAttibute, AttributeOperation.EQUALS, "com.ibm.team.apt.workItemType.story");
                Expression plannedForExp = new AttributeExpression(plannedForAttribute, AttributeOperation.EQUALS,null);
              
              Expression teamAreaExp = new AttributeExpression(teamAttribute, AttributeOperation.TEAM_AREA_EQUALS,"ESA-LMT");

But team area i am not able to fetch ??Any hints
           

0 votes


Accepted answer

Permanent link

If you had a proper setup (setup the SDK and plain Java together) you would basically be able to see that there is no (built in) attribute for the team area similar to the project area: com.ibm.team.workitem.common.model.IWorkItem.PROJECT_AREA_PROPERTY .

The reason is, that there is no attribute for this. Everything with Team Area in work item editor presentations or query editors is just made up. The only relationship (in built in attributes) of a work item and a team area I am aware of is the work item category (Filed Against) com.ibm.team.workitem.common.model.IWorkItem.CATEGORY_PROPERTY.

As far as I can tell, if you want to find work items "belonging" to a team area, you will have to find the categories associated to the team area and use them in the query.

vinitha dsouza selected this answer as the correct answer

0 votes

Comments

I had the time and checked how that is done in the API. See the section "Synthetic Attributes" in https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ for how that works and where to look.

1 vote

Thank you very much ! It works like a charm

Welcome, it was a revelation to find that one. The question has come up before.

 As a side note, I was taking a look at the code, and it appears that TeamArea is the only queryable synthetic attribute.

Yea. Realized that later on as well. Leave it to the reader to realize it as well. And you never know if there will be a new one in the future. Stranger things have happened.

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,943
× 411

Question asked: Nov 14 '17, 3:03 a.m.

Question was seen: 2,031 times

Last updated: Nov 15 '17, 5:47 a.m.

Confirmation Cancel Confirm