New Jira Dashboard Feature Filters

Hi all - it seems that the new Dashboard capability has the ability to get the dashboard filter that sits on top of the overall dashboard; however the nomenclature for something as like issue status does not match and there does not appear to be an API to convert the overall dashboard filter into a JQL filter. Granted we could reverse engineer a mapping, but that seems fragile and problematic.

Here’s an example of the filter data accessible by the new dashboard widget

{
  "id": "0e8dc2ba-d7be-4313-9ced-44c51386e227",
  "operator": "OR",
  "groups": [
    {
      "id": "7658d29c-3840-45d7-9f6e-f37e08f51dd7",
      "operator": "AND",
      "groups": [
        {
          "id": "0275684b-42a7-49bd-8946-a72b52c14c9f",
          "label": "Work item status",
          "comparison": "in",
          "defaultValues": [],
          "dimensions": [
            {
              "name": "issue_status",
              "product": "jira",
              "subProduct": null,
              "dynamicDimensionKey": null
            }
          ],
          "metadata": null
        },
        {
          "id": "56fc6e72-13d9-4cd2-a941-4aaea3a25aae",
          "label": null,
          "comparison": "in",
          "defaultValues": [
            "ari:cloud:jira:0068ce87-8e41-4389-bc45-6dc5d106b187:project/10235"
          ],
          "dimensions": [
            {
              "name": "project_name",
              "product": "jira",
              "subProduct": null,
              "dynamicDimensionKey": null
            }
          ],
          "metadata": null
        }
      ],
      "metadata": null
    }
  ],
  "metadata": null
}

and here’s an example of what you’d get from the https://.atlassian.net/rest/api/3/field api

{"id": "status","key": "status","name": "Status","custom": false,"orderable": false,"navigable": true,"searchable": true,"clauseNames": ["status"],"schema": {"type": "status","system": "status"}}

I feel like I’m missing some important detail about how one should map these fields or any combination of fields for that matter. Sure we can reverse engineer it and embed a map in our app, but that seems suboptimal.

Suggestions as I’m assuming I must be missing something?

Hi @lead_crimsalytics,

The docs don’t show a dimension-to-JQL conversion or a list of dimension names today. The useWidgetContext page types filters as a FilterExpression tree, with name, product, subProduct and dynamicDimensionKey on each dimension, and it stops there.

A small explicit map is the route for now. Map issue_status to status, and map project_name to project with the numeric id at the end of the ARI, since a project clause in JQL takes that id directly. Unknown dimensions should throw. A dropped clause quietly returns the wrong issues.

The module is new, so names may change, and I haven’t tested this against a live dashboard.

Raimundas asked for the same thing in post 28 of the GA thread (is the extension.filters shape stable, and when will it be documented), and that part hasn’t been answered yet, so adding your payload there gives it more weight.

Thank you! This is what I did. I basically added 3 modes to my dashboard widget:

  1. Dashboard only filter
  2. Dashboard filter AND’d with a filter defined in my widget’s config
  3. My widget only filter

For 1 & 2 if any unknown data source (anything other than Jira) or unknown jira field shows up, the app does the best it can to map the data to jira JQL fields. It shows a warning and lists the specific fields that it could not factor into the query along with their data sources. I explain the behavior in my docs. I also created a table to explain how fields in the UI are mapped to JQL. Maybe this is helpful others or at least copy/paste this context into your AI coding agent as a starting point as I imagine it will change over time. User guide · Crimsalytics