Why my regex return nothing ?

Rio Chandra
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!
October 11, 2022

I'm creating auto labelling using regex summary issue. I'm using this regex "(?!\[)[^\[\] ]+(?=\])". my expectation it will get text with format "[FE] [BE] test issue 1223" and return "FE, BE". But, it return nothing. I have tried to use custom field

{
    "fields": {
      "labels": {{#varlabel}}{{.}}{{/}}
    }
}

How to set label issue using array ?
and how to log this array ?

 

Screenshot 2022-10-11 203534.png

 

Screenshot 2022-10-11 203901.pngScreenshot 2022-10-11 203911.pngScreenshot 2022-10-11 203944.png

1 answer

0 votes
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.
October 11, 2022

Hi @Rio Chandra -- Welcome to the Atlassian Community!

First thing, the documentation on match() states the "underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches."  Note the "based on" part; I suggest using as simple of a regular expression as you can to get a match first, and then start refining it.  I have encountered several things in the spec that do not work with automation rule, regular expressions.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

Next, when adding multiple labels at once from a smart value expression, please take a look at this example for the advanced edit to do so: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Labels

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events