Skip to main content
Skip table of contents

Accessing Custom Jira Fields via OSLC

OSLC Connect for Jira supports the standard shapes for OSLC Change Management objects. This allows users to use the standard identifiers to extract values for reports, searches, or other integrations. However, what if you want to use custom Jira fields in your reports. How would you consider doing this? And how would your tooling understand this new attribute?

The answer for this is Resource Shapes. In OSLC, this is the type definition for an object. This effectively describes the attributes and the types of attributes for a resource. In practice, this defines what attributes are available for an artifact for every Jira Issue in a particular Scheme.

Updating the Jira Resource Shape

The standard artifact shape attributes can be found in the OSLC Connect for Jira help. (https://help.sodius.cloud/help/topic/com.sodius.oslc.app.jira.doc/html/admin/server/trsFeeds.html?cp=0_0_1_0_2_3_0 ). However, we know users use extended attributes so we enable users to extend the types and we will describe below how to discover the ids to access them with remote tools.

With OSLC Connect for Jira, administrators can update the attributes included in the issue shape. This is done on a Jira Scheme level and modified in the Jira Administration for OSLC Connect.

image-20250225-181307.png

On this page, users can add additional Jira fields in the issue shape. Note that not all fields are supported and presented on the Jira form. More details are defined in the product help → https://help.sodius.cloud/help/topic/com.sodius.oslc.app.jira.doc/html/admin/server/issueShapes.html?cp=0_0_1_0_4_3

When this is updated, the next time the Shape is requested, or an artifact is requested, the extended attributes will be available for that scheme. If you have multiple schemes, each will need to be updated.

With tools like Report Builder, you will access the attribute's name. For other tools, users will need to request and review the shape and artifact data to guide their tool definitions.

Accessing the Resource Shape

OSLC interactions are common web interactions. If a tool or a user wants to access a resource shape they only need to request the shape document and read the contents. Many tools will do this automatically to aid in reporting, however, we occasionally need to access these directly.

When the remote tooling does not process the shape directly, users can use the features in OSLC Connect for Jira to review the shape of the resource.

The “Show Resource Shape” button (on the bottom left of the page) will show the following style popup.

image-20250225-181604.png

This provides access to the title and description of the artifact. The Property definition and type are used in reporting and accessing the artifact. For examples of this look to the next section.

Accessing the Issue Resource

OSLC interactions are common web interactions. If a tool or a user wants to access an issue resource they only need to request the document and read the contents. Many tools will do this automatically to aid in reporting, however, we occasionally need to access these directly.

Once a user has the resource shape shown, they may review a specific artifact by using their Jira key.

image-20250225-181915.png

Once selected the table expands to show that specific’s resource’s values.

image-20250225-182003.png

As well a user can download the resource in a native format like a reporting tool (json or rdf-xml). For example this is what the downloaded rdf-xml would be for this resource. You can see this includes the Jira artifact attributes and links.

CODE
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:jira_x="http://atlassian.com/ns/cm-x#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"
    xmlns:jira="http://atlassian.com/ns/cm#"
    xmlns:acc="http://open-services.net/ns/core/acc#"
    xmlns:sodius_process="http://www.sodius.com/ns/process#"
    xmlns:process="http://jazz.net/ns/process#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_config="http://open-services.net/ns/config#"
    xmlns:oslc_cm="http://open-services.net/ns/cm#"
    xmlns:jp="http://jazz.net/xmlns/prod/jazz/process/1.0/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" > 
  <rdf:Description rdf:about="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/issue/POL2310-2">
    <oslc_cm:closed rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_cm:closed>
    <oslc:shortId>POL2310-2</oslc:shortId>
    <rdf:type rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
    <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2024-03-06T14:21:58.428Z</dcterms:created>
    <jira:priority>Medium</jira:priority>
    <jira:reporter rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/user/10000"/>
    <oslc:serviceProvider rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/project/10400"/>
    <oslc:shortTitle rdf:parseType="Literal">POL2310-2</oslc:shortTitle>
    <oslc_cm:approved rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_cm:approved>
    <dcterms:creator rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/user/10000"/>
    <jira_x:customfield_10106 rdf:datatype="http://www.w3.org/2001/XMLSchema#double">16.0</jira_x:customfield_10106>
    <acc:accessContext rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/acclist#10400"/>
    <oslc_cm:status>To Do</oslc_cm:status>
    <dcterms:title rdf:parseType="Literal">Created from Polarion</dcterms:title>
    <oslc_cm:implementsRequirement rdf:resource="https://cambrai-polar.sodius.cloud/polarion/oslc/services/projects/drivepilot/workitems/DP-429"/>
    <process:projectArea rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/process/project-area/10400"/>
    <dcterms:identifier>POL2310-2</dcterms:identifier>
    <oslc_cm:fixed rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_cm:fixed>
    <dcterms:type>Story</dcterms:type>
    <oslc_cm:inprogress rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</oslc_cm:inprogress>
    <oslc:instanceShape rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/resourceShape/10400/issue"/>
    <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2025-02-25T18:28:16.63Z</dcterms:modified>
  </rdf:Description>
  <rdf:Description rdf:nodeID="A0">
    <dcterms:title>DP-429</dcterms:title>
    <rdf:object rdf:resource="https://cambrai-polar.sodius.cloud/polarion/oslc/services/projects/drivepilot/workitems/DP-429"/>
    <rdf:predicate rdf:resource="http://open-services.net/ns/cm#implementsRequirement"/>
    <rdf:subject rdf:resource="https://phoenix-jira.sodiuswillert.cloud/rest/oslc/1.0/cm/issue/POL2310-2"/>
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
  </rdf:Description>
</rdf:RDF>

Using this in Polarion Tables

One of the main uses of this information would be to add Jira information to tables or reports in Polarion. All the existing documents are used to create the tables. However, if you were to add the Story Points information to the table, you would modify your configuration from the example to the following:

CODE
<?xml version="1.0" encoding="UTF-8"?>
<remote-attributes-configurations>
 <remote-attributes-configuration remoteOslcType="oslc_cm:ChangeRequest">
   <attribute label="Jira Id" oslc="dcterms:identifier"/>
   <attribute label="Jira Status" oslc="oslc_cm:status" visible="true"/>
   <attribute label="Priority" oslc="jira:priority" visible="true"/>
   <attribute label="Story Points" oslc="jira_x:customfield_10106" visible="true"/>
 </remote-attributes-configuration>
</remote-attributes-configurations>

Note the addition of the jira_x and the usage of the id information for Sprint using the jira_x prefix.

To use ‘jira_x’ it must be added to the namespaces used in the OSLC Semantics in the Global Configuration of Polarion.

Navigate to the Default Repository in Polarion and the Linked Data Semantics

Make sure ‘jira_x’ is defined in the namespace.

It should be as follows:

CODE
<namespace prefix="jira_x" url="http://atlassian.com/ns/cm-x#"/>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.