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

Programmatically Query in RTC for Multiple ID Attributes

Hello Team,

I want to build query in RTC like how i create in Web,

for example i have 3 workitems which i want to query, i give in web id is 1000,1002,1003 like this.

Could you please suggest how can i get above behaviour programatically,

Below is code,

QueryableAttribute idAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea,
          IWorkItem.ID_PROPERTY, auditableCommon, monitor);
      // Creating an Expression
      String data = "1000,1001";
      Expression idExpression = new AttributeExpression(idAttribute, AttributeOperation.EQUALS, data);

Thanks

0 votes

Comments

Hello Team,
Can anyone of you answer this query?



2 answers

Permanent link

 I don't see this as a capability in the Query UI, so I don't see how it should be done with an expression. If you refer to full text search, you would have to use it in the expression. 


Otherwise split the input and use  findWorkItemById() as explained in https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/

0 votes

Comments

Actually why i require this,
i want get Code review findings. For this to achieve we have below SCM CLI
SCM -Codereview [Queryid]
Therefore i am creating query with all workitems and then pass it to SCM CLI to get Code review findings.

 I am getting tired from users that are not professional enough to even provide something remotely to their question (see:; How should I ask a question in the Forum if I want to receive useful answers? ) and then come up with the real question piece by piece. I am out f here. Good luck with your question.

Usecase:
Generate report with review findings for Snapshot.
I see only using SCM CLI 
Usage: scm export code-review [options] <queryId><outputFile>
Therefore We are following below algorithm
Algorithm currently being followed is:
1. Get Workitems from Snapshots.
2. Build Query programmatically with the Workitems found from snapshot.
3. Pass same queryid and get the Review findings.

Currently we are at step 2 where in which i want to create query programmatically with more no of workitems id.

Could you help now?


Permanent link

One approach would be to add a tag to those work items (such as "snapshot-135"), and then have a query for all work items with that tag.

0 votes

Comments

But this will lead to mail un wanted mail notifications to user.

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

Question asked: Oct 12 '17, 6:11 a.m.

Question was seen: 2,712 times

Last updated: Mar 07 '19, 5:40 a.m.

Confirmation Cancel Confirm