Error: "Failed to evaluate queries and expressions: input data must be a wide series" When Creating Alert with Infinity 2 Datasource

Hi everyone,

I’m currently trying to create an alert rule in Grafana using the Infinity 2 datasource

to evaluate Jira issues, but I’m running into an issue when setting up the alert conditions. Here’s the error I’m seeing:

**Failed to evaluate queries and expressions: failed to execute conditions: input data must be a wide series but got type not (input refid)**

Context:

  • Datasource: Infinity 2 (connected to Jira issues)
  • Query: Pulling Jira issues based on specific conditions like project and fixVersion. The query runs fine in the panel visualization and returns the expected results.
  • Goal: Set up an alert rule to evaluate the returned Jira data and trigger alerts based on certain conditions.

However, when trying to evaluate the query in the alert rule, I get the above error about needing a wide series but receiving something else.

What I’ve Tried:

  • Double-checked the query to ensure it’s returning data as expected.
  • Verified that the query works fine in the visualization panel but breaks during alert evaluation.
  • Parser was also set to Backend

Possible Issues:

  • Is there something specific I should configure in the query or transformations to convert the data into a wide series format that the alerting engine requires?

Any guidance on how to resolve this error or steps to ensure the data meets the “wide series” requirement for alerts would be greatly appreciated!

Thanks in advance!

Is it possible that you don’t have a number field in your query? I’ve gotten that error under that conditions, so Grafana didn’t know which field is the value and which are labels.

If that’s not it, can you share how your data looks like (anonymized if necessary).

Hey,

I don’t have a number field in my query. My URL query parameters are:

jql= project=ABC AND fixVersion=ABCD

The fields I’m querying are: key, summary, assignee, status, created, and updated.

I was experimenting with an alert condition that triggers when more than two issues are returned by this query. My expression is a classic condition: when the count() of query A is greater than 2, it should send a notification.

Do you mean what my data looks like when it is in a panel or when I try to do the alert rule?

Ok, so Grafana alerts work either on numbers or time series. The count reduce is for reducing time series into a single number. I’m not too familiar with Jira API but I assume it returns something like:

{
  "issues": [
  {
    "key": "key1",
    "summary": "summary1",
    "assignee": "assignee1",
    "status": "status1",
    "created": "created1",
    "updated": "updated1"
  },
  {
    "key": "key2",
    "summary": "summary2",
    "assignee": "assignee2",
    "status": "status2",
    "created": "created2",
    "updated": "updated2"
  }
]
}

If so, you can use Backend parser to get the count of the issues. then in parsing options, you can use following code to get the count:
$count(issues)

If there’s no such field (if Jira returns only the array of matched issues), then you can use $count($) to get the count from root of the json (I think the first one is more probable).