The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Jira automation rule: Capture a string ending with 2 options

William van Dalen
Contributor
March 15, 2025

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

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
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 Champions.
March 15, 2025

Hi @William van Dalen 

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

William van Dalen
Contributor
March 24, 2025

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

Like • Bill Sheboy likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events