Polarion Advanced Scripting Victorien Alric
Polarion Advanced Scripting Victorien Alric
ABSTRACT
Large companies are organized in several departments that might have their own
ways of working; the aim of this project was to unify the way of working across
selected departments. Doing so enables traceability and transparency of ongoing
activities in each department, resulting in a better visibility of available workforce
and enabling management teams to make decision to allocate resources where
needed and provides a general overview of activities within selected departments.
All in all, this task management project provided satisfying results by enabling
transparency and facilitating communication between employees among selected
departments.
ACKNOWLEDGMENT
ABSTRACT
1 INTRODUCTION ............................................................................................ 1
1.1 Bases of Project Management ................................................................... 1
1.2 Project Background ................................................................................... 1
1.3 Project Objectives ..................................................................................... 2
1.4 Project Scope ............................................................................................ 3
2 TECHNOLOGIES AND TOOLS .................................................................... 4
3 TECHNICAL BACKGROUND INFORMATION ......................................... 6
3.1 Key Polarion Features ............................................................................... 6
4 TEAMS AND ROLES ..................................................................................... 9
5 PROJECT PHASES ....................................................................................... 10
5.1 Project Planning ...................................................................................... 10
5.2 Work Breakdown .................................................................................... 11
5.3 Work Planning ........................................................................................ 11
5.4 Work Execution ...................................................................................... 11
6 DEFINITION OF WORK ITEM TYPES ...................................................... 12
6.1 Project Package ....................................................................................... 13
6.2 Work Request.......................................................................................... 16
6.3 Tasks ....................................................................................................... 17
7 POLARION ADVANCED SCRIPTING ....................................................... 20
7.1 Workflow scripting ................................................................................. 20
7.2 Highcharts Live Report Development .................................................... 22
8 CONCLUSIONS ............................................................................................ 28
REFERENCES...................................................................................................... 29
List of abbreviations
UI User Interface
1 INTRODUCTION
Project management is the process of organizing the work of a project with given
constraints. The most common challenges in project management are budget,
schedule planning and resources availability. The role of a project manager is to
find balance between these parameters and carry the project to completion in
accordance with initial requirements and scope.
During the initialisation phase, the requirements are gathered, the final scope is
defined and approved by relevant stakeholders. The planning phase is where the
work is broken down in smaller pieces and the schedule is defined and
communicated with the resources allocated for the project. The work is being
performed by assigned teams during the execution phase. During the monitoring
phase, the results are tested and verified against initial requirements to ensure the
result is satisfying. Some small adjustments or refinement can be made before
closing the project.
The main purpose of the studied task management project is to have a unified way
of working and a common tool for all employees in selected departments, enabling
traceability of the work taking place in between these departments, increasing
visibility and predictability of upcoming activities while facilitating the
prioritization process. An efficient task management system also speeds up the
information sharing of dependent work from a department to another by automating
communication of key information.
3
The scope of this project is limited to the task management and project management
aspect and does not cover requirements management or product lifecycle
management. It is a more generic approach that may apply to a variety of
enterprises. One of the goals is to demonstrate capabilities and flexibility of the
Polarion software and demonstrate how the tool can be tailored for demanding
environments.
4
This section lists all technologies used for implementing the task management
solution proposed.
• Polarion ALM
Polarion is a tool that hosts all data and configuration related to the task
management project. Polarion has the ability to define “workItems” which are
customer defined objects containing pre-defined fields. Polarion stores all
workItems in the XML format in an integrated Subversion repository and provides
a browser-based user-interface to create, configure and display workItems. /1/
Apache Velocity (v1.4) is a language used by Polarion for internal scripts or reports.
It is available in “Rich Pages” or “Live Report Pages” which allow customers to
write their own scripts.
• JavaScript
Polarion supports the JavaScript language in “Live Report Pages” alongside the
HTML code. JavaScript can also be used in scripts hosted on the Polarion server,
for example workflow scripts or scheduled scripts.
• Highcharts
• Apache Lucene
The following query example can be used in Polarion to fetch workItems of type
“Task” assigned to user with id “U001” in “Open” status.
Polarion ALM was first released in 2004 by Polarion Software and acquired by
Siemens in January 2016. Polarion is a unified solution for Requirements, Quality,
and Application Lifecycle Management. Targeted at large enterprises, it allows any
given organization to deeply customise the software to meet complex and specific
requirements. /1/
Polarion ALM gives organizations one unified solution that delivers project
transparency through real-time aggregated management information. Everyone is
aligned around what is being built and why to drive advancement while protecting
integrity and compliance. This helps teams respond faster and with better quality to
new business opportunities and customer demands. The solution is based around
three core pillars: collaboration, traceability and reuse of content.
• User management
Like the majority of productivity tools, Polarion needs a system to manage its users.
Each user has an advanced set of permission applied to specific projects. The
Polarion user database can be integrated with well-known identity management
systems, such as OAuth, Kubernetes or LDAP.
• Projects
A Polarion project is a space within the repository, similar to a file folder. All
configuration and content related to a project is stored within the project folder. The
project has its own Polarion configuration and its own set of users and permissions.
Each project has its own configurable home page.
• WorkItems
it is up to the administrators to define different workItem types and select fields that
shall be used and when needed, create additional fields.
• Documents
Documents are similar to “Microsoft Office Word” documents but allows creation
of workItems by selecting relevant text and marking it as a workItem. These
documents can be exported as PDF. A typical use of documents is to maintain and
develop a list of requirements.
Live Report Pages or Rich Pages, are live documents that can load widgets and run
custom Apache Velocity scripts that supports HTML and JavaScript content as
well. For example, the home page of each project consists of a Live Report Page
and usually contains information on the project users and recent activity and a
dynamic table of the workItems recently updated in the project.
• Plans
Plans are workItem collectors with a display page similar to a Live Report Page. A
plan requires a starting date and ending date, it has its own workflow. For example,
in software development projects, a plan might represent a two-weeks sprint and
contain several WorkItems of type “Task” which are assigned to different persons.
Polarion Plan is a great solution to enable a team to follow up progress on the
scheduled tasks and provides a report that can be used during regular meetings held
by the team.
• WorkItem linking
All of the above mentioned Polarion core functionalities are available to users via
a web browser through the Polarion user-interface, but some of the functionalities
can be accesses through the Polarion API.
In a large-scale enterprise, employees are assigned different roles and teams, they
might work on the same project with different roles. A breakdown of different roles
relevant for task management is detailed below.
• Project Managers
Project managers are responsible for the development of a given project, their role
is to ensure the project meets the requirement and is completed within cost and time
restrictions. To do so, the project managers have to break down and list all the work
that needs to be done to fulfill project requirements. Once this step is achieved, they
can provide an estimate for remaining cost and give a target completion date.
• Department Managers
• Team Managers
Team managers are responsible for a certain team. They plan the work together with
the team members according to priorities coming from the department managers.
• Team Members
Team members are the persons executing tasks according to the schedule agreed
with the team manager. It is essential to maintain strong coordination between
members and organize regular meeting to ensure targeted schedules are met.
10
5 PROJECT PHASES
This chapter introduces the four main project phases in project management and
their translation in Polarion configuration.
Project planning is the initial project phase which consists of deciding whether or
not to create a new product or a new feature. An analysis is performed based on
requirements handed over by customers or by internal stakeholders. During this
phase, requirements are set, the initial project plan is prepared, schedule and costs
are estimated. The work is broken down into Polarion workItems of type “Project
Packages” and relevant departments are consulted to discuss the scope of the
department engagement and commitment to the project. Scheduling is organized
according to each department’s availability. This step will result in a project plan
11
approved by all interested parties. A “Project Package” can represent a large amount
of work and is typically completed within months.
During work breakdown, project managers and departments manager discuss and
define Polarion workItems of type “Work Request” which are assigned to relevant
departments with agreed schedules. A “Work Request” shall be completed within
a few weeks so the “Project Package” is updated regularly.
Department managers discuss priorities and further distribution during regular order
intake meetings.
The team manager and team members gather to break own the work further from
“Work Requests” to Polarion workItems of type “Task”. They prioritize and plan
the work. Tasks are assigned to each team member according to their capacity and
specialty.
Once the work is planned, it is time to execute the work and complete the tasks.
Once all tasks are completed, the parent “Work Request” item is set to “Closed”
status. Once all “Work Requests” are closed, the parent “Project Package” can be
set to “Completed” status. This process enables traceability across departments and
the information displayed is always up to date. At the team level, the work is
planned regularly and new tasks are processed within short time, a task shall not
represent more than a few days of work.
12
At the start of the project, the departments involved had different way of working
with different tools. Some were sharing progress via email or tracking tasks via
Excel while others had different task management tools.
The work breakdown process is different for each department but eventually the
source of the work is common to all: business driven requirements which translate
into a new project being initiated.
In this example, only three type of workItems are used, additional layers can be
added according to organization structure, complexity and size.
Polarion has built-in fields for all item types which are enabled by default. These
fields include: title, description, status, resolution, author, assignee, initial estimate,
time spent, priority and comments. In addition to these fields, one may create
additional custom fields of certain data type: single line text, html text, integer,
floating point, date, Boolean or enumeration. It allows the work item objects to suit
most of one’s needs.
Once the fields are defined, Polarion offers workItem form layout customization
settings in the form of an XML file and determine how the fields will be displayed
when opening a workItem in a web browser.
13
The “Project Package” workItem is the highest “work collector” and is driven by
the project management team.
Figure 5 represents the entire workflow of the Project package which consists of
six statuses:
To help understanding the table in Figure 5, an analysis of the first row is given
below:
In Figure 6, “Draft” status is the initial status, the row reads as follow: “When the
project package is in “Draft” status, it is possible to make a transition to “Planned”,
“Closed or “On Hold” status.” The table shall be read one row at the time, the
leftmost column represents “from” and the header of each column represents “to”.
In addition to the status transition, some fields can be marked as required to reach
certain status, in this example, to transition to “Planned” status, at least one linked
Work Request to the Project Package is required.
A work package may be linked to a Work Request with the defined link role
“Processes” so that a Work Request “processes” a Project Package.
Figure 7. Linked item creation shortcut menu from a Project Package item
Polarion allows to quickly create a linked workItem by clicking the “+” icon under
the workItem title. Once a Work Request is linked and analyzed, all its data
regarding cost and schedule will be automatically summed up and sent to the Project
Package item.
16
Work Requests contains additional fields, such as Analysis which must be filled in
order to move forward from “Draft” to “Analyzed” status. The department-level
team must analyze all the work required to complete this Work Request and break
it down into tasks which are linked to the Work Request in a similar manner than
Work Request are linked to Project Package.
17
Figure 9 represents the workflow of the Work Request workItem which consists of
six statuses:
Once the work analysis has been performed, the Work Request can move from
“Analyzed” into “Planned” status, which means that all the tasks have been
assigned to team members and are scheduled to meet the requested date.
6.3 Tasks
Tasks are the smallest work container and shall be executed within a couple of days.
Figure 10 shows the interface of the Task workItem.
Tasks contains crucial information, such as Due Date set by the team manager but
also the planning information (Planned Start Date, Planned End Date) which is set
by the team. The “Planned In” field offers the possibility to use Polarion Plans and
add this task to the relevant plan (for example bi-weekly development sprints, in
accordance with the team’s way of working).
18
“Work Records” field can be used to register all the worked hours, when a team
member work on this specific task, he may record the time spent on this task each
day, this way the remaining estimate and total time spent is updated and summed
up in the parent Work Request which is carried up into the parent Project Package.
There are only three layers of workItem types, so the tasks are only linked to their
parent work request. Tasks do not have children’s items.
In addition to the “Processes” link role, one may use “Depends On” role. For
example, a task assigned to Team 1 depends on a task assigned to Team 2 so that
Team 1 cannot complete their task unless Team 2 have finished implementation.
This information is very useful and can be highlighted in dynamic reports.
20
This chapter focuses on Polarion scripting capabilities with two examples showing
what can be done with workflow scripting and LiveReport scripting using the
Highcharts library.
When a team member starts executing a Task, the status is set from “Draft” to “In
Progress” and the parent Work Request is automatically set to “In Progress” status
as well, this ensures the Department manager is notified that the work started.
if (workitem.can().modify()) {
// Foreach linked workitem
for (i = 0; i < linkedWi.size(); i++) {
// Returns the ID of the link role
linkRoleResult =linkedWi[i].getLinkRole().getId();
// If link role match the desired link role
if(linkRoleResult === linkRole){
// Return the parent workItem
var parent= linkedWi[i].getLinkedItem();
// Check permission to edit the parent item
if (parent.can().modify() == true) {
21
parent.performAction(actions[j].getActionId());
// Save the parent item
parent.save();
}}}}}}}
Code sample 1. Workflow script to modify linked workItems status
This script is loaded into the task’s workflow “Start Progress” action configuration
where the script name and parameters are given.
The workflow script configuration must include two main parameters as well as
three custom parameters:
The Highcharts library is very flexible and offers a lot of customization options,
one may find more information from the Highcharts API documentation. /5/
The following chart consists of a bar chart calculating past and future workload of
selected department and a line representing available work hours capacity. The
purpose of this chart is to provide visibility of the department resource allocation.
The workload shall always be below the capacity to avoid over-booking the
resources. This report can be displayed for each department to compare resource
allocation between them.
23
The data related to workload comes from Task workItems in Polarion, the data
regarding capacity comes from the user calendar feature in Polarion where one can
set their regular working hours as well as exceptions, such as vacations or national
holidays. The elaboration of such chart can be divided into two steps, the collection
of data from Polarion database and the chart configuration using Highcharts API.
The first step of retrieving data from Polarion consists of building a Lucene query.
In this example, there are only three query parameters: “project.id” which limits
the item search to the current project only, “type” which limits the search to
workItems of type “Task” only and “resolvedOn” date filter which excludes all
tasks that have been closed before the beginning of the chart’s timeline (two
weeks before today). The language used in these live report pages is Apache
Velocity 1.4.
The first line defines the $query variable of type String containing the Lucene
query. The second line retrieve the corresponding workItems into the $items
variable which is an array of workItem objects.
24
Once the data is extracted, the data is parsed for each period in the chart. The work
records are distributed to their corresponding time stamps and the remaining
estimated hours of the tasks is proportionally distributed between “Planned Start
Date” until the “Planned End Date”. If they are not “In Progress” status, in that case,
the distribution of the remaining working hours is done between “Today” and
“Planned End Date”. After which, the user calendar information is fetched.
#foreach($user in $teamMembers)
#foreach($day in [1..$daysInPeriod
#set($dailyHours = 0) ## How many hours in that day
## Fetch specific day informaiton of working calendar of the current user
#set($workingDay = $workingCalendar.getWorkingDay($dailyLoop.getTime,true))
## If this day is a working day
#if($workingDay.isWorking)
#foreach($entry in $workingDay.getWorkingTimes)
#set($dailyHours =
$math.div($math.sub($entry.getToTime,$entry.getFromTime), 3600000))
## Add daily hours (ex. 8h) to the daily capacity of that person.
#set($capacityUserStep = $math.add($capacityUserStep,$dailyHours))
#end
#end
$!dailyLoop.add(6,1) ## Add one day
#end
## Add the capacity of user in the period to the overall capacity of that step
for all users
#set($capacityStep = $math.add($capacityStep,$capacityUserStep))
#end
Code sample 3. Velocity code to retrieve data from a user's calendar
At this point, workItems have been saved in an array and the hours estimate are
saved in dedicated variables. The capacity of all involved users is also stored in
$capacityStep variable.
25
var options = {
title: {
text: 'Workload vs Capacity',
},
xAxis: {
categories: $periodsArray,
crosshair: true,
},
yAxis: { // First axis, workload
min: 0,
title: {
text: 'Hours',
},
},
plotOptions: {
column: {
stacking: 'normal',
},
series:{
cursor: 'pointer',
point: {
events:{
click: function() {window.open(this.options.url);}
}} }, },
Code sample 4. Highcharts parameters in JSON format
The series data which consists of processed data extracted from Polarion is then
passed to Highcharts for each series, this data contains the hours value for each
period as well as URL redirecting to the list of selected tasks.
26
series: [
{
name: 'Draft',
type:'column',
color: 'lightblue',
data: $draft,
},
{
name: 'In Progress',
type:'column',
color: 'rgb(8,103,149)',
data: $inProgress,
},
{
name: 'Resolved',
type:'column',
color: 'green',
data: $closed,
},{
name: 'Capacity',
type: 'spline',
color: 'rgb(255,115,33)',
data: $capacity,
}
]
Code sample 5. Highcharts series options in JSON format
Formulas for calculating the average hours depending on each status and available
date field data are not detailed in this publication but it is important to note that the
process remains the same regardless of the type of chart needed and consists of four
steps:
Note: The same chart can be rendered for Work Requests or Project Package simply
by changing the “type” filter in the main query.
This results in a dynamic live chart where each column can be clicked to open the
list of included tasks. This scalable chart is used by Project Managers, Department
Managers and Team Managers and offers a quick overview of resource availability
and upcoming workload with the possibility to see the details of the items.
28
8 CONCLUSIONS
This thesis work highlights the complexity of project management and coordination
challenges within a large enterprise and proposes a generic solution to solve this
problem with the help of Polarion software.
Polarion is a powerful and flexible tool that requires a large investment and effort
to fit in a complex enterprise environment but will provide great added value to any
given productive.
In this project, human factor or other challenges that may be encountered were not
taken into account. Polarion is also a great solution for requirement management
which is also part of project management. Requirements management is a discipline
of its own, the process of setting up requirement management configuration using
Polarion have similarities with setting up of the task management project. At first,
the roles and responsibilities are defined, then comes Polarion workItems
configuration followed by workflow and fields definition, the final setup can be
continuously improved later with custom reports and automation scripts.
29
REFERENCES