Jira automation : JQL syntax in conditions

Raphaël
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 5, 2023

Hi all,

I want to change the state of an issue when the GIT pull request associate with it is merged. But I have to select the correct state depending on the destination branch of the pull request.

I explain :
- classical developments have to go on a "preproduction" branch
- hot fixes have to go directly on the "production" branch.

So I have to test the PR destination branch with the smart value {{pullRequest.destinationBranch}} . When I add this value to log, I see it, no problem.

But I don't know / don't find documentation on how to test this in a JQL condition or an advanced search comparison, any help ?

 


I've tried many things, with or without quotes, with "in" or "=" or "equals()"... Log always tells me that doesn't match. Here's some examples.

 

Advanced search comparison :

Screenshot 2023-06-06 at 08-56-38 Configuration JIRA - Jira.png

JQL Condition :

Screenshot 2023-06-06 at 08-57-01 Configuration JIRA - Jira.png

1 answer

1 accepted

2 votes
Answer accepted
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.
June 6, 2023

Hi @RaphGC -- Welcome to the Atlassian Community!

Have you tried using the match() function with a regular expression, and an advanced compare condition?

Kind regards,
Bill

Raphaël
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2023

Thanks @Bill Sheboy for the welcome, and thanks a lot for the answer, indeed, it seems to work with a regular expression.

I tried (without success) the match() function :

Screenshot 2023-06-07 at 07-58-41 Automatisation - Jira.png

But I think I still have syntax problem. But you put me on the way with regex, and the next one is working :

Screenshot 2023-06-07 at 08-00-30 Automatisation - Jira.png

Thanks again !

Like Bill Sheboy likes this
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.
June 7, 2023

I am glad to learn you got it to work.

And it appears when you were using match() that you were missing the grouping in the regular expression:

.match(".*(master).*")

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