Skip to content

SchweizerischeBundesbahnen/ch.sbb.polarion.extension.json-editor

Repository files navigation

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Reliability Rating Security Rating Maintainability Rating Vulnerabilities

JSON Editor Extension for Polarion ALM

This Polarion extension provides possibility to edit JSON files as WorkItem attachments.

Important

Starting from version 2.0.0 only latest version of Polarion is supported. Right now it is Polarion 2410.

Quick start

The latest version of the extension can be downloaded from the releases page and installed to Polarion instance without necessity to be compiled from the sources. The extension should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.extension.json-editor/eclipse/plugins and changes will take effect after Polarion restart.

Important

Don't forget to clear <polarion_home>/data/workspace/.config folder after extension installation/update to make it work properly.

Build

This extension can be produced using maven:

mvn clean package

Installation to Polarion

To install the extension to Polarion ch.sbb.polarion.extension.json-editor-<version>.jar should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.extension.json-editor/eclipse/plugins It can be done manually or automated using maven build:

mvn clean install -P install-to-local-polarion

For automated installation with maven env variable POLARION_HOME should be defined and point to folder where Polarion is installed.

Changes only take effect after restart of Polarion.

Polarion configuration

JSON editor to appear on a WorkItem page

  1. Open a project which WorkItem pages should display the editor
  2. On the top of the project's navigation pane click ⚙ (Actions) ➙ 🔧 Administration. Project's administration page will be opened.
  3. On the administration's navigation pane select Work Items ➙ Form Configuration.
  4. On the form configuration page you will see 2 sections: Form Filters and Form Layouts.
  5. In the table of Form Layouts section find line with WorkItem's type where editor should appear and click 📝 Edit
  6. In opened Form Layout Configuration editor find a line with code:
    …
    <field id="description"/>
    …
  7. Insert following new line after it (with explicit syntax validation on submit):
    …
    <extension id="json-editor" label="JSON Editor" validateOnSave="true"/>
    …
    Or following new line after it (without syntax validation on submit):
    …
    <extension id="json-editor" label="JSON Editor" validateOnSave="false"/>
    …
  8. Save changes by clicking 💾 Save

REST API

This extension provides REST API. OpenAPI Specification can be obtained here.