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":{}}
I am using the generic rule builder to create the rule, where must I add your script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These are the only options I have in the Condition section, can you be a bit more specific?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your case here you can add ScriptRunner Script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
now it shows everything as true even if the text is not there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me see on my side and get back to you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.