Hey community,
I'm trying to set up a rule that is getting bit complex and hoping someone here can help me out. Here's what I have so far in the rule:
Hi @Vishal Thakkur -- Welcome to the Atlassian Community!
For scenarios like this, context is important. What would an example Description that contains your values look like? Knowing that may help to improve the parsing expression.
Until we see that...
Two things about the match() function could be causing challenges with the parsing you describe:
Kind regards,
Bill
Hi Bill, As described earlier my description would contain IP address it could be any type like Private IP or Public IP but there is no specific description it may change for every alert but IP address would be always there.
Example Description - Srchost: 10.14.122.2
MAC : 006648572879
Domain :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information; I would first remove the newlines before trying the match.
Please also note, the documentation states:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--
Note that "is based on" as it does not specifically indicate what does / does not work for regular expression syntax. Several other community posts have found regular expressions which work elsewhere do not work the same in automation rules.
I encourage starting with the simplest expression that can possibly work, testing, and only then incrementally add more to handle edge cases, testing as you proceed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Vishal Thakkur
Have you tried to remove those brackets..
{{issue.description.match(".*(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b).*").split(",").distinct.remove("[").remove("]")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah I tried that and instead of removing bracket it removed the value inside it and result was - [], []
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
LOL, sorry. I am sure other experts can share simpler solution but next thing I can think of is to create a variable and store current output in it and then do remove operation there.
if you create myvar variable = {{issue.description.match(".*(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b).*").split(",").distinct}}
then you can do {{myvar.remove("[").remove("]")}} to remove them and it will be comma separated values. Yes, the variable is a text string but when you send it in your payload in web request, it will operate as a list.
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.