Hi,
A Jira smart value question in an automation rule :
In the description of a Jira issue i captured a string until this string ends with a new line. This works fine.
{{issue.description.substringAfter("Subject").split("\n").first().
However, sometimes instead of a new line (\n) the string ends with a horizontal line (---). Hoe can i combine this (thus new line and horizontal line).
Regards, Will
How often do you expect the "---" text in your Description, in what format / length, etc.?
You could try first replacing multiple occurrences of hyphens with a single newline using the replaceAll() function and a regular expression. For example:
{{issue.description.replaceAll("(\-{3,})", "\n").split("\n").first}}
When you expect multiple hyphen sections / horizontal lines, you may need to account for which record to access, rather than assuming it is the first one.
Kind regards,
Bill
Hi Bill,
With your reply eventually i wrote {{issue.description.substringAfter("Subject:").replaceAll("---", "\n").split("\n").first()}}.
I tested it and i sent it to the consultant. It looks that it's okay.
Thank you for your support.
Regards, Will
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.