Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to get value from JQL condition

Luca Tuchtefeld January 28, 2025

Hi All,

 

i try to use the following expression in a JQL condition of my automation:

 

{{issue.summary.match(".*("Verification of correctness by Legal").*")}}

 

I receive the following error-message:

 

 

Failed to get value for issue.summary.match(".*("Verification of correctness by Legal").*"): {{issue.summary.match(".*("Verification of correctness by Legal").*")}}

 

Does anyone have an idea how to fix that?

 

Thanks for your help, Luca

3 answers

1 vote
Rilwan Ahmed
Community Champion
January 28, 2025

Hi @Luca Tuchtefeld 

Welcome to the community !!

Did you try using simple JQL like summary ~ "\"Verification of correctness by Legal\""

More details about match is described in https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

 

1 vote
Tomislav Tobijas
Community Champion
January 28, 2025

Hey @Luca Tuchtefeld ,

Try removing quotation marks next to the string you're trying to find/match.

So, try just this:

{{issue.summary.match(".*(Verification of correctness by Legal).*")}}

Cheers,
Tobi

Luca Tuchtefeld January 28, 2025

Hi Tobi!

I tried this already. If I remove them, it tells me that "of" is a protected jira term. If I remove the quotation marks and "of":

 

{{issue.summary.match(".*(Verification correctness by Legal).*")}} 

 

it tells me:

 

"(key IN (PLCB-46) AND ())" - Error in the JQL Query: Expecting a field name but got ')'. You must surround ')' in quotation marks to use it as a field name. (line 1, character 24)

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

Hi @Luca Tuchtefeld -- Welcome to the Atlassian Community!

Adding to the suggestion from @Tomislav Tobijas ...

You are trying to use the result of that match in a JQL statement, and so it must be enclosed in quotation marks.  That could be done in various ways, including adding the asJsonString function at the end: https://confluence.atlassian.com/automation/jira-smart-values-json-functions-993924865.html

However, as this is static text you are trying to match in the Summary field, testing directly may be better than using a JQL condition.  For example, using an Advanced Compare Condition and checking if the results of the match are not empty.

Kind regards,
Bill

Like Tomislav Tobijas likes this
0 votes
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

@Luca Tuchtefeld 

Can you share screen shot of the automation rule that you have written so far?

if your objective is to check if the summary contains the sentence "Verification of correctness by Legal", why can't use an if block with contains conditions instead of a RegEx?

Luca Tuchtefeld January 28, 2025

Hi Vishal,

 

I need to use the smart values because I would like to use an OR condition to check if the summary contains X or Y. For now I didnt include that because first I would need to get this formula running.

 

 

image.png

Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

@Luca Tuchtefeld 

 

Try using this, this works - i.e. {{smart values}} condition 

 

snip.png

 

 

 

Luca Tuchtefeld January 28, 2025

I did:

{{issue.summary}} matches .*(Verification correctness by Legal).*

Received:

No subsequent actions were performed since JQL condition did not pass due to error running JQL:
"(key IN (PLCB-46) AND (Verification correctness by Legal matches .*(Verification correctness by Legal).*))" - Error in the JQL Query: Expecting operator but got 'correctness'. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 37)
The automation is in data-center based jira, not cloud.
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

@Luca Tuchtefeld 

i am able to replicate your error with the 2nd control in the below screen shot.

Are you sure you are using the 1st one shown in the screen shot i.e. compare two values?

 

snip.png

Luca Tuchtefeld January 28, 2025

@Vishal Biyani The only difference is the "of", right? I took out the "of" of the expression but also out of the issue summary, so this shouldnt cause a problem.

Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2025

@Luca Tuchtefeld 

are you using "compare two values"?

please don't use issue matches JQL. that will fail

Suggest an answer

Log in or Sign up to answer