Skip to content

polarion/

Polarion as a Platform - Extensions, Workflow Functions, and Customizations That Survive

Andrei Bespamiatnov

Andrei Bespamiatnov

Author

Polarion is not just a repository of work items

Most teams meet Polarion as a place to type requirements. That is fine. The interesting work starts when a status change has to do something: write a field, call another system, publish a resource, or refuse a transition because the data is incomplete.

At that point Polarion is an extension host. If you treat the script editor as a scratch pad, you will get a production process that only one person can debug.

I have spent a lot of time on Polarion customizations: workflow functions, OSLC-facing scripts, and catalogs that other people can actually find. This is the operating model that kept those customizations alive after the original author moved on.

Separate “source” from “what you paste”

Polarion’s in-product script box is a deployment target, not a repository.

I keep two trees on purpose:

  • src/ — the readable version. Comments, names, a README that says when to use it.
  • dist/ (or a single paste file) — the compact form the product accepts. No node_modules, no lab experiments, no “tmp2”.

The README has two sections: what the function does in the product, and how to land a change. If you cannot explain the landing steps in a page, the customization is not ready.

A catalog index at the root beats a shared drive full of final_v7.js.

Workflow functions should do one job

A workflow function that “updates SharePoint, writes the audit field, sends email, and also fixes the title” will be un-ownable in six months.

One transition, one responsibility:

  • Validate the work item is allowed to leave this state.
  • Call one external API.
  • Write back the identifiers you need for the next human.

If you need three side effects, make three functions or an explicit orchestrator you can test without the server. Polarion is a bad debugger.

Calling the outside world from a transition

The pattern that holds up is boring:

  1. Read only the fields you need.
  2. Build a small payload with stable IDs (the Polarion id, status, and a URL the other system can open).
  3. Call the external API with a secret that is not in the script.
  4. Persist the remote id or the error in a field a human can see.
  5. Fail the transition if the other system did not accept the write.

I have used this for document libraries and for OSLC-style resources. The transport changes. The shape does not.

Do not hide failures in logs only the admin can see. If the work item says “Published” and the other system never got the row, you have a lie in the process.

OSLC-facing scripts are a different animal

If the script is there to expose or consume linked resources, treat identity as the product.

  • Stable URIs beat display titles.
  • A mapping table (local type → resource shape) belongs in version control.
  • Discovery and query are not the same as “we hardcoded one project.”

I already wrote about RDF and OSLC integration patterns in a separate article. The Polarion-specific lesson is simpler: the script is an adapter, not the semantic model. Keep the model in one place. Let Polarion call it.

What makes a customization survive an upgrade

Upgrades punish cleverness.

  • Prefer the documented scripting API over scraping the HTML of the UI.
  • Avoid depending on internal class names you found in a stack trace.
  • Keep lab scripts out of the catalog. A spike can live in a scratch folder. It must not ship.
  • Write a one-page “how to re-paste after upgrade” note. Someone will need it on a Friday.

The customizations I still trust are the ones a new engineer can re-deploy from the catalog without asking me which of the six copies is real.

A checklist before you put it on a project

  • Can you name the trigger in one sentence?
  • Can you name the single side effect?
  • Is the secret outside the script?
  • Is there a field that shows success or failure to a normal user?
  • Can someone else find the source in the catalog without Slack?

If any answer is no, you do not have a platform customization yet. You have a favor you did for one project.