Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Edited

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

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}}"

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
TAGS
Community showcase
Published in Jira Automation

New to Jira Automation - goodbye Cron (sort of), hello new project created trigger, new additions to

Hey Everyone! Simeon from the Automation team here. I'm delighted to share some new features and improvements that we are shipping to Jira automation (Cloud only). Firstly, @Sam Harding&nbsp...

2,825 views 10 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you