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

Code Review Export using SCM Tools for Snapshot

Hello Team,
i have before raised the same question ,below is the link

We have snapshot and retrieving 100's workitem.
Can you just give an example on how can i build a query with these work items ids and then pass to cli command for export.


Thanks

0 votes



One answer

Permanent link
You'd have to write a work item query which picks up all those work items somehow. Perhaps they all have a particular "Planned For" period? Or perhaps you write a script which goes through all those work items and sets a tag such as 'in_snapshot_x', then write a work item query to find work items with that tag?
Otherwise there's no way to do this (work item code does not know anything about scm snapshots...)

0 votes

Comments
yes, i have logic to get the workitems from the snapshot. Now my query is,
we are seeing 100+ workitems.In UI, i can build query with id's of workitems with or condition. How can i do the same behaviour programmatically?
i would like to have,
OR
id -1001
OR
id -1002
But when with below code i get when i see in UI,
id -1001,1002,1003
which results in exception because it reached max length
code:
      Term queryTermOperator = new Term(Term.Operator.OR);
      for (IWorkItemHandle eachWI : workItems) {
          IWorkItem workItem = auditableCommon.resolveAuditable(eachWI, IWorkItem.FULL_PROFILE, null);
          queryTermOperator.add(new AttributeExpression(idAttribute, AttributeOperation.EQUALS, workItem.getId()));
        }

Could you please help here

error which we have got is below,
com.ibm.team.repository.common.validation.PropertyConstraintException: Validation errors for item: type = QueryDescriptor, itemId = [UUID _4QPacBmyEemRA9oS-YkAFQ]
        Value of attribute "internalExpression" is 100022 bytes, which is greater than the allowed encoded length of 32768 bytes.

I'm not on the Work Items team, so I can't help you here.
I suspect you won't be able to create a query with that many expressions.
(maybe build up multiple work item queries?)

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

Question asked: Mar 06 '19, 10:04 a.m.

Question was seen: 1,897 times

Last updated: Mar 07 '19, 10:12 a.m.

Confirmation Cancel Confirm