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, that is, 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 extracted as metadata but aren’t indexed by default. The metadata names follow the pattern fields.customfield_<ID>, where <ID> is the unique numeric identifier of the custom field in Jira. To index this metadata, you need to associate Jira custom field names with their unique IDs.

Finding the ID of a custom field

You can get the ID of a custom field from your browser’s developer tools:

  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 previous example, 11102 is this ID.

Creating a Mapping Rule

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

fields.customfield_<ID>

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

Example

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 dropdown menu in the Jira Software user interface. In such case, your mapping rule should rather be in the format:

fields.customfield_<ID>.attributeName

where attributeName is the name of the desired JSON attribute.

Example

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, that is, the value of the value attribute, so you update your mapping rule as follows:

fields.customfield_12345.value