You might want to modify existing project templates or even create a complete new one, to instantiate new projects based on your own templates – adapted to your specific processes.

Here I will explain the absolute basics about the structure of project templates.

To understand project templates, lets take a look at the project structure in the repository.
Projects have a structure like this in the repository:

Project Structure
  • .polarion – Contains most: configurations, test runs, free work items etc.
  • wiki – Is for old wiki pages (Rarely used nowadays)
  • modules – Documents and the work items they contain

These folders contain everything project related. Configurations, work items, documents etc.

If you want to have a project template based on an existing project, you have to do at least four things:

  • Copy the project out of the repository
  • Add a text file called template.properties to the project folder
  • Replace the project id in .polarion/polarion-project.xml through %project-id%
  • Zip the folder and upload it in the global administration under „Project Templates“

The template.properties needs to contain at least the following content:

name=Template_Name
description=Description of the Template
process=.polarion/polarion-project.xml;
trackerPrefixToReplace=ABC

Quick explanation of the content:

  • name – is the name of the template
  • description – the description shown, when you select the template during creation
  • process – these are the files, which Polarion will go trough during the creation process and will replace the variables %project-id% trough the entered project id during creation.
  • trackerPrefixToReplace – the prefix of work items in the project to replace it be the new tracker prefix.
Template Structure

After adding the template.properties file you have to Zip the whole folder. (The zip file will contain the project template folder)

Zip contains Project Template Folder

After uploading the project template to Polarion in the global administration, you can select the template during project creation.

In upcoming posts I will show an example, how you can create an automatic build management for template creation with Jenkins. If you want to go for it via Polarion Build Management only, check this out: https://extensions.polarion.com/extensions/234-template-factory

This is a project, where a build management is configured, so that a template will be created out of the current project. Including changing author names to system administrator.

Basics: Polarion Templates

Beitragsnavigation


4 Gedanken zu „Basics: Polarion Templates

  1. Hi, thank you very much for your interesting posts, I have one question concerning the file access.template which is used to create access rights for users to the repo folders of the project. I first tried to create such a file based on the information in the help and locked myself completely out of – fortunately – our test platform. The situation got better when I edited a file from another template. Probably you could give a post on how to correctly create such a file.

    1. Hello Volker Storm,
      this is a good idea. It will get on my list of future topics 🙂
      Although I wonder a bit, that you locked yourself completely from the test platform – as the access template should be project specific then.
      Could you fix it?
      Kind regards,
      Florian

  2. Hello,

    Can we discuss some things as I needed some help regarding polarion and I found your post regarding it ,if possible can we communicate over discord ,teams or something .I really need some guidance as I am unable to find anywhere

    Thank You

    1. Hi Shubham,

      the next blog post will be about this issue in detail. Showing how to set up a professional template development environment (Polarion & Jenkins):
      – Rename Users automatically to System Admin
      – Replacing project ids with %project-id%
      – Adding template.properties
      – Zipping

      –> Fully automated
      But although I set this up recently and it „just“ has to be documented. I won’t be able to afford the free time for atleast the next two weeks to do this.

      Kind regards,
      Florian

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert