Map Jira Software Cloud Custom Fields

Once you have added a Jira Software source, you need to create mapping rules to index your content metadata.

Coveo automatically indexes the standard metadata of Jira Software issues, i.e., the content of standard issue fields is indexed in generic Coveo fields such as firstname and date, as well as in Jira-specific Coveo fields starting with ji.

Custom Jira Software fields, however, are not indexed by default. So, when creating mapping rules to index this metadata, an extra step is required, as you need to find their unique ID.

Finding the ID of a Custom Field

When creating a mapping rule for a custom field from Jira, you need to provide its unique identifier.

You can get this information from your browser’s developer tool:

  1. In your Jira Software instance, access an issue in which the desired custom field appears.

  2. Right-click the name of the field, and then click Inspect (in Chrome) or a similar option to open the developer tool.

    The highlighted element should appear within an element similar to the following:

     <li id="rowForcustomfield_11102" class="item">
    

    In the id attribute, the number following rowForcustomfield_ is the field unique identifier in Jira Software. In the example above, 11102 is this ID.

Creating a Mapping Rule

Metadata from a custom Jira Software field is made available to Coveo Cloud sources with the following name format:

fields.customfield_n

where n is the custom field ID. This is the format to use in your mapping rule.

For custom field 11102, your mapping rule is %[fields.customfield_11102].

With some custom fields, a mapping rule such as the one above may index a JSON object rather than a single value. This typically happens with custom fields whose possible values are predefined and available from a drop-down menu in the Jira Software user interface. In such case, your mapping rule should rather be in the format:

fields.customfield_n.attributeName

where attributeName is the name of the desired JSON attribute.

You created the mapping rule %[fields.customfield_12345]. Once the source has been rebuilt, you see in the Content Browser that the corresponding Coveo field contains the following JSON object:

{  "self": "https://myjira.atlassian.net/rest/api/2/customFieldOption/12345",  "value": "Core",  "id": "12345" }

The value you want to index in your Coveo field is actually Core, i.e., the value of the value attribute, so you update your mapping rule as follows:

fields.customfield_12345.value

Recommended Articles