Here are the sample labels on a ticket
ABC-1.234.0.1
ABC-1.567.0.0
ABC-2.345.9.0
EGF
XYZ
I plan to count labels with ABC-X.XXX.1-9.X
So the field should return 1 because of ABC-2.345.9.0
I can't seem to get things to work. Please help.
I've scriptrunner, jmcf, and jwt. :)
Using as JMCF Calculated Number field, the formula would be:
issue.get("labels")?.count{it.label ==~ /TC-[0-9]\.[0-9][0-9][0-9]\.[1-9]\.[0-9]/}
Note that your JWT regular expression is somewhat incorrect, as "." stands for "any character", not the "." character. Also, you don't need the parentheses.
Thanks David! I'll try this one as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Resolved using Calculated Text Field by JWT.
toString(count(findPattern(toString([%{Labels}]), "TC-([0-9]).([0-9][0-9][0-9]).([1-9]).([0-9])")))
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.