How to create the workItem Query for attachment file size more then 1MB by JAZZ API ?
Accepted answer
I got the result by JAVA API using the below logic:
IQueryableAttribute attachmentAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectAreaObject, "link:com.ibm.team.workitem.linktype.attachment:target",auditableCommonObject, monitor);
attachmentAttribute = attachmentAttribute.getChildAttribute(CONTENT).getChildAttribute(CONTENT_LENGTH);
Expression exAttachmentSize = new AttributeExpression(attachmentAttribute , AttributeOperation.GREATER_OR_EQUALS, 1048576);
term.add(exAttachmentSize);
3 other answers
com.ibm.team.repository.common.IContent.getRawLength()
e.g. com.ibm.team.workitem.common.model.IAttachment.getContent().getRawLength()
https://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/
https://rsjazz.wordpress.com/2012/11/19/using-an-expression-to-synchronize-attributes-for-work-items-of-a-specific-type/
Comments
I still don't see it in the work item query editor at least in 6.0.
I could not see related to attachment expression .
For some reason, the Attachments -> Content -> Content_Length query term is only available in the Eclipse UI (not in the Web UI). And if you view a query in the Web UI with that query term, you see there is a term, but no information about that term.
thanks for your response.
IQueryableAttribute attachmentAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectAreaObject, "link:com.ibm.team.workitem.linktype.attachment:target",auditableCommonObject, monitor);