It's all about the answers!

Ask a question

Programmatically Query in RTC for Multiple ID Attributes


vinitha dsouza (14719119) | asked Oct 12 '17, 6:11 a.m.

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


Comments
vinitha dsouza commented Oct 16 '17, 7:22 a.m.

Hello Team,
Can anyone of you answer this query?

2 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Oct 16 '17, 5:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Comments
vinitha dsouza commented Mar 07 '19, 5:40 a.m.

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


permanent link
Ralph Schoon (63.1k33645) | answered Oct 16 '17, 7:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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/


Comments
vinitha dsouza commented Oct 16 '17, 9:24 a.m.

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.


Ralph Schoon commented Oct 16 '17, 9:41 a.m. | edited Oct 16 '17, 9:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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.


vinitha dsouza commented Oct 16 '17, 10:16 a.m.

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?

Your answer


Register or 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.