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

Receiving error when using Generic Rule: Summary DOES NOT CONTAIN certain text

Louwrens Boshoff March 31, 2023

I want to stop a ticket from using this transition if it contains certain text.

Rule test error: {"errorMessages":["Jira expression failed to parse: line 1, column 2:\nIDENTIFIER or } expected, status encountered."],"errors":{}}

1 answer

0 votes
Oday Rafeh
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.
March 31, 2023

Hi @Louwrens Boshoff , 

 

Can you try this : 

!(issue.summary.toLowerCase().contains("certain text"))
Louwrens Boshoff March 31, 2023

I am using the generic rule builder to create the rule, where must I add your script?

Oday Rafeh
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.
March 31, 2023

@Louwrens Boshoff 

In the generic rule builder, you can use the "Condition" section to specify the Jira expression that checks if the summary of the issue contains the specified text.

In the "Condition" section, select the "Jira Expression" option.

Replace the default expression with the following code:

!(issue.summary.toLowerCase().contains("certain text"))

Replace the "certain text" string with the text that you want to check for in the summary of the issue.

Louwrens Boshoff March 31, 2023

image.png

These are the only options I have in the Condition section, can you be a bit more specific?

Oday Rafeh
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.
March 31, 2023

In your case here you can add ScriptRunner Script

Louwrens Boshoff March 31, 2023

I see, it give me this error:

image.png

Oday Rafeh
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.
March 31, 2023

Maybe the "contains" is not available regarding this error, Please try in place of it to use the "indexOf()" this way : 

 

!(issue.summary.toLowerCase().indexOf("certain text") >= 0)
Louwrens Boshoff March 31, 2023

now it shows everything as true even if the text is not there.

Oday Rafeh
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.
March 31, 2023

@Louwrens Boshoff it looks like the condition is not correctly evaluating the summary field let's try using a different approach

 

!issue.summary?.toLowerCase().contains("certain text")
Louwrens Boshoff March 31, 2023

image.png

Oday Rafeh
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.
March 31, 2023

Let me see on my side and get back to you 

Louwrens Boshoff March 31, 2023

Thx

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events