Boolean validator Parse Error using count

Issue #953 resolved
Corey Patterson created an issue

I'm attempting to use a Boolean validator to evaluate if an existing ticket exists using the criteria of 2 custom fields. We have Department and Dept. Priority custom fields. We logically roll up the Departments into a sudo Head Department (not an actual field in JIRA) and allow each Head Department to rank 3 tickets 01-03 for candidates to put on our production support kanban board. I need to prevent someone from having multiple 01 priority tickets set based on the head department. So attempting to use IMPLIES and count(issuesFromJQL) validation.

Attached is the Config and Parse Error.

Comments (7)

  1. Fidel Castro Armario repo owner

    Hi @corepatt,

    Please, attach the text of the boolean expression you are trying to use, so that I will be able to test it.

  2. Fidel Castro Armario repo owner

    Hi @corepatt,

    Can you, please, tell me which type are fields %{10101} and %{10007}?

  3. Fidel Castro Armario repo owner

    Try the following boolean expression:

    (%{10101} in ["Department 1","Department 2","Department 3"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 1\",\"Department 2\",\"Department 3\")")) = 0)
    AND
    (%{10101} in ["Department 4","Department 5","Department 6","Department 7","Department 8","Department 9","Department 10"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 4\",\"Development\\QA\",\"Department 6\",\"Department 7\",\"Department 8\",\"Department 9\",\"Department 10\")")) = 0)
    AND
    (%{10101} in ["Department 11","Department 12"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 11\",\"Department 12\")")) = 0)
    AND
    (%{10101} in ["Department 13","Department 14"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 13\",\"Department 14\")")) = 0)
    AND
    (%{10101} in ["Department 15","Department 16"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 15\",\"Department 16\")")) = 0)
    AND
    (%{10101} in ["Department 17","Department 18","Department 19","Department 20","Department 21","Department 22","Department 23"] IMPLIES count(issuesFromJQL("project = '" + %{00018} + "' AND issuekey != '" + %{00015} + "' AND \"Dept. Priority\" = \"'" + %{10007} + "'\" AND status = \"Pending Assignment\" AND assignee = fequeue AND Department in (\"Department 17\",\"Department 18\",\"Department 19\",\"Department 20\",\"Department 21\",\"Department 22\",\"Department 23\")")) = 0)
    

    The cause of the syntax error was a missing + operator after %{10007} when composing the string for the JQL query.

    I have also added some parentheses and changed OR connective with AND because I think that those changes are necessary in order to make the expression behave as you expect.

  4. Log in to comment