How do I properly use strings in a "For JQL" automation rule when using smart values?

Eric Masyk June 11, 2020

Jira/Apps Versions:

  • Jira Server: 8.8.1
  • Automation for Jira: 7.1.14
  • JQL Search Extensions: 3.1.3

Description of the automation which I want to accomplish:

  • Trigger: On change of "Customer Name" field
  • For JQL: "Customer Name" ~ {{issue.Customer Name}}
  • Then: Edit issue and copy "Customer Name" from "Trigger issue"

The automation is triggering properly, and it's correctly finding the "Customer Name" field, which in my test case, contains the string "ACME INC, Co."  This breaks the automation because there are spaces in the name (see error below).  Since the field I'm wanting to match is a free text field, it will always contain a string (name) with a varying number of spaces, special characters, lengths, etc.

Below is my error, which to me is obvious that I need to somehow create the "For JQL" search to treat the "Customer Name" as a string, but for the life of me I cannot find any documentation on how to accomplish that:

  • TIX-439: "(("Customer Name" ~ ACME INC, Co.) AND (key != TIX-439)) AND (project in (redacted))" - Error in the JQL Query: Expecting either 'OR' or 'AND' but got 'INC'. (line 1, character 31)

How do I make the Jira automation wrap ACME INC, Co. in quotes so it treats it as a text string?  TIA!

1 answer

2 votes
Eric Masyk June 15, 2020

I found a colleague who had the same issue but figure out the solution, so I'm putting it here for others, and it's quite simple:

Wrap your smart value in quotes, OUTSIDE the braces.  FWIW, I did everything BUT that... Not sure why this isn't clearly documented anywhere, my colleague had the same issue finding an answer, and stumbled upon it by brute force trial and error...

Example: "{{issue.Customer Name}}"

Petar Andreev July 2, 2020

This was something I was banging my head on for so long. Thank you for sharing!

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events