How to use lucene query in live report (live doc)

Description
adbarads
Posts: 11
Joined: Mon Nov 13, 2017 7:47 pm

How to use lucene query in live report (live doc)

Postby adbarads » Tue Sep 25, 2018 3:20 am

So, I'm pretty familiar with using SQL in a live report. And putting the SQL query in a script block.
then using $sqlService.executeQuery()

I was curious if I can call a Lucene query instead, and have that returned like in an array or some other fashion like from a typical SQL query.

I am looking to see if there is a lucene query that will return all workitems (type:testcase and HAS_VALUE:custom_field).
and maybe return in an array.

mhoe
Posts: 25
Joined: Tue Nov 29, 2016 3:30 pm

Re: How to use lucene query in live report (live doc)

Postby mhoe » Tue Sep 25, 2018 5:54 am

In LiveReports you can do:
#set($workitems = $trackerService.queryWorkItems("type:testcase and HAS_VALUE:custom_field","id"))

I don't know if it is the same in LiceDocs, since there is used wiki code, but i am not familiar with that.

Also have a look at
https://almdemo.polarion.com/polarion/sdk/index.html

adbarads
Posts: 11
Joined: Mon Nov 13, 2017 7:47 pm

Re: How to use lucene query in live report (live doc)

Postby adbarads » Wed Sep 26, 2018 6:19 am

thanks, this was exactly what I needed.

full solution for anyone else that may need it:
#set($workitems = $trackerService.queryWorkItems("project.id:some_proj_id AND type:testcase AND HAS_VALUE:custom_field","id"))

can also do this for an array count:
$trackerService.queryWorkItems("projectid:some_proj_id AND type:testcase AND HAS_VALUE:custom_field","id").size()

basically it's call function and insert a lucene query.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 5 guests