Page 1 of 1

Reporting: (Historical) Status Change of Workitems

Posted: Thu Jan 18, 2018 11:37 am
by PatrickClaus
Hello everyone,

I am one of the administrators for Polarion @ Valeo Siemens Erlangen, and I am at the moment tasked with several reporting and quality management services for customer projects.

I would like to propose a general question:
At the moment, we have the need for certain queries and report-widgets/scripts, which are able to depict workitems that had their status changed in a certain time frame.

For example:
I'd like to show all workitems in the last 7-30 days which transitioned from a status "Approved" to "Sent to Customer", e.g. This means that there should be some historical query process, which examines modifications to the status attribute of the workitem in this specified time period.
While not inherently neccessary, filtering of such workitems would help in certain report cases.

Is there any feasible way to achieve this, either by Velocity/Lucene or SQL-queries?
Or are there any existing report widgets / extensions that I have missed?

I would be glad for any feedback regarding this topic.

Re: Reporting: (Historical) Status Change of Workitems

Posted: Sun Jan 21, 2018 2:32 pm
by ALMighty
PatrickClaus wrote:Is there any feasible way to achieve this, either by Velocity/Lucene or SQL-queries?

I think there is a way to write some Velocity code for this in a Wikipage. Though I think there are possibilities to include Velocity code Widgets or other options, I would try out the wiki pages for testing purposes at first.
If wik pages do not fulfill your needs because e.g. they are not shiny enough, then you could try to run the code to somewhere else.

Where to start?

I can tell you only some shallow details now because I have not my system with my Polarion at my disposal (it is Sunday after all, no work day usually here in Europe).

The first thing I would go for is to getting the DiffManager to generate Histories for a object.

With this code you can get the Diffmanager in a wiki page:

Code: Select all

#set($diffManager = $trackerService.getDataService().getDiffManager())

In the Diffmanager, you have the method generateHistory(), which needs a PObject as aparameter (a PObject can represent basically anything with an URI in Polarion, work items included), fetching PObjects can be done with methods of the DataManager, like sqlSearch().

Check my answer in the thread SQL query example for workitems in a plan. There I listed how to execute SQL queries in wikipages (if you want to use the sqlSearch() method/function).

Also, check the Javadoc of the DiffManager.

Maybe my hints help, tell me if you have a update on this or a result (or if you achieved no result).

Note: In my opinion the easiest way is to have a Java programme cycling through the history, there is an formidable Java SOAP API for Polarion. I can tell you more about that if you want, especially about details how to set up such a Java project in Eclipse.

Re: Reporting: (Historical) Status Change of Workitems

Posted: Tue Jan 23, 2018 10:05 am
by PatrickClaus
Hey there,

many thanks for your reply, and also for your PM. (I can not respond to that directly, as I'm a newly registered user, which is...kinda strange..)

I will look into the snippets and information provided here, and figure out if I can customize some solution, given the appropriate free time for doing so.

Will be back with an update to this, hopefully sometime soon.

Re: Reporting: (Historical) Status Change of Workitems

Posted: Wed Apr 18, 2018 8:49 am
by dejavu030507

I have tried to implement generateHistory() method in my wikipage. However, it shows nothing. Could you please review the code below:

#set ($projectID = $page.project)
#set ($project = $trackerService.getTrackerProject($projectID))


#set ($wiType1 = $pageParameters.getAsString("type1"))
#set($dataService = $trackerService.getDataService())
#set($diffManager = $trackerService.getDataService().getDiffManager())

#set ($sqlAllItems="$sqlAllItems where true and PROJECT.C_ID = '$projectID' and WORKITEM.C_TYPE = '$wiType1'")
#set ($all_items = $dataService.sqlSearch($sqlAllItems))

#set($ignoredList = ["feature", "component"])

#foreach ($w1 in $all_items)
#set ($changes = $diffManager.generateHistory($w1, $ignoredList))

#foreach ($change in $changes)

Many thanks.