The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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 Champions.
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).*")
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events