how to query small string customized attribute?
Hi Friends,
I created a customized attribute, type small string named "siglaSistema" but the query by this attribute broken
Here is the code:
WorkItemQueryModel model= WorkItemQueryModel.ROOT;
IItemQuery query= IItemQuery.FACTORY.newInstance(model);
IPredicate predicate = model.workItemType()._eq("FRM");
predicate = predicate._and(model.projectArea()._eq(projectArea));
predicate = predicate._and(model.stringExtensions().key()._eq("frm_classe_req_mudancas"))._and(model.stringExtensions().value()._eq("frm_classe_req_mudancas.literal.l6"));
predicate = predicate._and(model.stringExtensions().key()._eq("siglaSistema"))._and(model.stringExtensions().value()._eq((siglaSistema)));
predicate = predicate._and(model.internalState()._eq(wiDto.getAttributeValue()));
IItemQuery query= IItemQuery.FACTORY.newInstance(model);
IPredicate predicate = model.workItemType()._eq("FRM");
predicate = predicate._and(model.projectArea()._eq(projectArea));
predicate = predicate._and(model.stringExtensions().key()._eq("frm_classe_req_mudancas"))._and(model.stringExtensions().value()._eq("frm_classe_req_mudancas.literal.l6"));
predicate = predicate._and(model.stringExtensions().key()._eq("siglaSistema"))._and(model.stringExtensions().value()._eq((siglaSistema)));
predicate = predicate._and(model.internalState()._eq(wiDto.getAttributeValue()));
Am I doing somethng wrong?
Thank you for any help
Regards!
One answer
I have no experience with using the query model for querying work items. I usually used the expressions and work item queries. See https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ and https://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/ .