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

How to query work item's customized attribute?

I have a customized attribute named 'extendStatus' and type is string. But the query by this attribute is broken. Here is the code segment.

WorkItemQueryModel model= WorkItemQueryModel.ROOT;
IItemQuery query= IItemQuery.FACTORY.newInstance(model);
IPredicate predicate = model.workItemType()._eq(query.newStringArg());
predicate = predicate._and(model.projectArea()._eq(projectArea));
predicate = predicate._and(model.stringExtensions().key()._eq('extendStatus'))._and(model.stringExtensions().value()._notEq('ARCHIVED'));

If i change the type to medium string, the query can work. My question is whether work item query model can support string extentions. If not, why stringextension exists in the model... Thanks in advance.

0 votes



One answer

Permanent link
I have a customized attribute named 'extendStatus' and type is string. But the query by this attribute is broken. Here is the code segment.

WorkItemQueryModel model= WorkItemQueryModel.ROOT;
IItemQuery query= IItemQuery.FACTORY.newInstance(model);
IPredicate predicate = model.workItemType()._eq(query.newStringArg());
predicate = predicate._and(model.projectArea()._eq(projectArea));
predicate = predicate._and(model.stringExtensions().key()._eq('extendStatus'))._and(model.stringExtensions().value()._notEq('ARCHIVED'));

If i change the type to medium string, the query can work. My question is whether work item query model can support string extentions. If not, why stringextension exists in the model... Thanks in advance.



You have most likely defined a custom attribute of type 'string'. In the query model, this corresponds to largeStringExtensions() and is not queryable. The mapping from custom attribute type to state extensions is as follows:

'string' -> largeStringExtensions (not queryable)
'mediumString' -> mediumStringExtensions()
'smallString' -> stringExtensions()

If you need a large string field, this is still searchable via full-text query.

HTH,
Patrick
Jazz Work Item Team

0 votes

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,952

Question asked: May 07 '09, 11:50 a.m.

Question was seen: 5,909 times

Last updated: May 07 '09, 11:50 a.m.

Confirmation Cancel Confirm