Querying selective attributes of item
I need item info structured as per attributes. However, only some attributes need to be selected. When I use IItemQuery, item info is structured as per attributes but pulls up all attributes. So, I tried the following(IDataQuery) but it does not show the data structured around attributes. Instead it shows every thing organized as <rawData>. Can some one suggest what is to be added to the following piece?
IQueryService queryService = getService(IQueryService.class); ContributorQueryModel queryModel = BaseContributorQueryModel.ContributorQueryModel.ROOT; IDataQuery query = IDataQuery.FACTORY.newInstance(queryModel); query.select(queryModel.itemId(), queryModel.name()); IDataQueryPage contributorByNamePage = queryService.queryData(query, IQueryService.EMPTY_PARAMETERS, IQueryService.ITEM_QUERY_MAX_PAGE_SIZE); return contributorByNamePage; |
One answer
There is good support for querying items with desired attributes.
Example: String [] Props ={"itemId", "name"}; IItem[] items = repositoryItemService.fetchItems(itemQueryPage.handlesAsArray(), Props); |
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.