Hi!
I'm able to match a single issue key using this JQL:
key = "{{webhookData.pull_request.title.match("(CMS-\d+)")}}"
But it fails if the title contains multiple keys. So I tried using the IN operator instead:
key IN {{webhookData.pull_request.title.match("(CMS-\d+)")}}
but it failed since the values are not quoted right or not a proper list?
"(key in CMS-296, CMS-297) AND (project in (XXXX))" - Error in JQL Query: Expected ')' but got ','.
How can I turn the values returned from `match()` into something that can be used with the IN operator?
Hi @Dan Michael Heggø -- Welcome to the Atlassian Community!
When you use the IN operator, JQL expects a list. Please try to wrap that expression with parentheses, leading to something like:
key IN ( CMS-296, CMS-297 )
And...as you are testing on the keys directly you do not need the project IN (XXXX) expression.
Kind regards,
Bill
Thanks, adding parentheses helped:
key IN ({{webhookData.pull_request.title.match("(CMS-\d+)")}})
What confused me at first was that I thought I needed quotes around each key, but turns out I don't!
The `project IN ..` is added automatically by Jira btw., since the automation rules are defined in a project, but you're right that they're not needed per se.
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.