Documentation

Entity Property

Entity properties allow add-ons to add key/value stores to JIRA entities, such as issues or projects. This module allows you to request those entity properties to be indexed by JIRA and able to be queried via JQL searches. They are also available in the following conditions:

  • entity_property_equal_to
  • entity_property_equal_to_context
  • entity_property_contains_any
  • entity_property_contains_all
  • entity_property_contains_context

Overview

The purpose of this module is to specify what data from which entity properties should be extracted and indexed. Pretend that an add-on developer has an issue entity property with the key 'attachment' and in that entity property they store the following data:

  
 {
     "size": 14231,
     "name": "new-years-jam",
     "extension": "mp3",
     "updated": "2016-12-25T20:55:59"
 }
  
 

In this example the developer wants to make the size, extension and updated fields under the attachment key searchable via JQL. To do that they start by declaring that the entityType to index will be an 'issue' entity type; this is specified at the top level of their module. Then they need to specify which entity property key they wish to extract data from: so they add a single entry to keyConfiguratons with propertyKey set to 'attachment'. If there are multiple issue entity properties that an add-on developer wanted to index then they could add more keyConfigurations to declare those extra properties. From there the add-on developer specifies which data they want to extract from the json value that is stored in this issue entity property. In this example they would add three extractions for the size, extension and updated paths under the attachment key, being clear to specify the type of data being extracted and what alias should be made available to JQL queries.

It is important to note that array types can be indexed too; the type field in the extraction should be the type of each element in the array.

You can see the resultant module definition in the example below.

For more information, please see the JIRA documentation on entity properties.

Example

{
  "modules": {
    "jiraEntityProperties": [
      {
        "keyConfigurations": [
          {
            "extractions": [
              {
                "objectName": "size",
                "type": "number",
                "alias": "attachmentSize"
              },
              {
                "objectName": "extension",
                "type": "text",
                "alias": "attachmentExtension"
              },
              {
                "objectName": "updated",
                "type": "date",
                "alias": "attachmentUpdatedDate"
              }
            ],
            "propertyKey": "attachment"
          }
        ],
        "entityType": "issue",
        "name": {
          "value": "Attachment Index Document"
        },
        "key": "attachment-entity-property"
      }
    ]
  }
}

Properties

key

Type
string
Required
Yes
Description

A key to identify this module.

This key must be unique relative to the add on, with the exception of Confluence macros: Their keys need to be globally unique.

Keys must only contain alphanumeric characters and dashes.

The key is used to generate the url to your add-on's module. The url is generated as a combination of your add-on key and module key. For example, an add-on which looks like:

{
    "key": "my-addon",
    "modules": {
        "configurePage": {
            "key": "configure-me",
        }
    }
}

Will have a configuration page module with a URL of /plugins/servlet/ac/my-addon/configure-me.

name

Required
Yes
Description

A human readable name.

entityType

Type
string
Defaults to
issue
Allowed values
  • issue
  • ISSUE
  • user
  • USER
  • project
  • PROJECT
  • Description

    The type of the entity. The default value is issue.

    keyConfigurations

    Description

    List of properties from which selected values are indexed.