スマート バリュー - テキスト フィールド

Jira のプロセスとワークフローを自動化する

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

robotsnoindex

The following smart values are available to access and format text strings when setting up a rule. Check out how we use smart values in our Jira automation template library.

The examples below use the summary field value of Hello World!.

abbreviate(int maxLength)

Abbreviates the text string to the defined number of characters and adds "..." to the end. The maxLength parameter needs to be at least 4.

{{issue.summary.abbreviate(8)}} -> Hello Wo...
{{issue.summary.abbreviate(4)}} -> Hell...

For more information, see: StringUtils.abbreviate(int).

asNumber

Takes a string, and converts it to a number if possible. Otherwise, returns null.

{{issue.summary.asNumber}} -> Null

charAt(int index)

Identifies the character at the specified position in the text string.

{{issue.summary.charAt(2)}} -> e
{{issue.summary.charAt(12)}} -> !
{{issue.summary.charAt(7)}} -> W

For more information, see: String.charAt(int).

capitalize()

最初の文字を大文字にします。

{{issue.summary.capitalize()}} -> Hello world!

For more information, see: StringUtils.capitalize(String).

concat(String str)

Adds a specified text string to the end of the returned value.

{{issue.summary.concat(" It's a beautiful day!")}} -> Hello World! It's a beautiful day!

For more information, see: String.concat(String).

endsWith(String str)

Checks if the text string ends with the specified text, and returns true or false.

{{issue.summary.endsWith("World!")}} -> true
{{issue.summary.endsWith("World@")}} -> false

For more information, see: String.endsWith(String).

equals(string)

Takes a text field and checks if it is equal to the given string. Returns true if the strings are equal. Can be used in conditional logic.

{{issue.summary.equals(“hello world!”)}} -> false

equalsIgnoreCase(string)

Takes a text field and checks if it is equal to the given string, regardless of case. Returns true if the strings are equal. Can be used in conditional logic.

{{issue.summary.equals(“hello world!”)}} -> true

htmlEncode()

テキストをエンコードして HTML コンテンツに含められるようにします。

{{issue.summary.htmlEncode}} -> Hello world!

indexOf(String str)

Returns the position of the first character in the specified text string.

{{issue.summary.indexOf("Wo")}} -> 6
{{issue.summary.indexOf("ello")}} -> 2
{{issue.summary.indexOf("d!")}} -> 11

For more information, see: String.indexOf(String).

isAlpha()

Checks if the text contains only letters, and returns true or false.

{{issue.summary.isAlpha()}} -> true

For more information, see: StringUtils.isAlpha().

isAlphanumeric()

Checks if the text contains only letters or numbers, and returns true or false.

{{issue.summary.isAlphanumeric()}} -> true

For more information, see: StringUtils.isAlphanumeric().

isEmpty()

Checks to see if the text is empty, and returns true or false.

{{issue.summary.isEmpty()}} -> false

For more information, see: StringUtils.isEmpty().

isNotEmpty()

Checks to see if the text is not empty, and returns true or false.

{{issue.summary.isNotEmpty()}} -> true

For more information, see: StringUtils.isNotEmpty().

isNumeric()

Checks if the text contains only numbers, and returns true or false.

{{issue.summary.isNumeric()}} -> false

For more information, see: StringUtils.isNumeric().

jsonEncode()

Encodes text to allow it to be included in JSON calls, for example, the send outgoing web request action. 

{{issue.summary.jsonEncode}} -> Hello World!

View Json encoding below for details on encoding when sending outgoing webhooks as JSON.

lastIndexOf(String str)

Returns the position of the last character in the specified text string.

{{issue.summary.lastIndexOf("wo")}} -> 7
{{issue.summary.lastIndexOf("ll")}} -> 4
{{issue.summary.lastIndexOf("rl")}} -> 9

For more information, see: string.lastIndexOf(String).

left(int length)

Returns the characters, from the specified amount of characters, from the left of the text string.

{{issue.summary.left(5)}} -> Hello
{{issue.summary.left(9)}} -> Hello Wor
{{issue.summary.left(2)}} -> He

For more information, see: StringUtils.left(int).

leftPad(int length, String pad)

Adds characters to the beginning of the text until the specified total number of characters is reached.

{{issue.summary.leftPad(14, "-")}} -> --Hello World!
{{issue.summary.leftPad(20, "|")}} -> ||||||||Hello World!

For more information, see: StringUtils.leftPad(int, String).

length()

Returns the number of characters in the text string.

{{issue.summary.length()}} -> 12

For more information, see: String.length().

match()

Performs a regular expression search and returns the first (and only one) matching regular expression group.

The underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches. If multiple matches are found, they return as a collection that can be iterated. This can be used to find a single pattern match (e.g. extract a version number from the issue description) or to match multiple patterns (e.g. extract all e-mail addresses from an issue comment).

{{issue.summary.match(".*(lo).*")}} -> lo {{issue.summary.match(".*(o).*")}} -> [o, o]

quote()

Escapes the smart value into a literal text expression that can be used in a regular expression match using Pattern.quote().

{{issue.summary.quote()}} -> \QHello(.*)World!\E<

remove(String remove)

Removes characters from text.

{{issue.summary.remove("l")}} -> Heo Word!

For more information, see: StringUtils.remove(String).

replace(String target, String replacement)

指定した置換内容で一致する文字テキストを置換します。

{{issue.summary.replace("Hello","Goodbye")}} -> Goodbye World!

For more information, see: String.replace(String, String).

replaceAll(String regex, String replacement)

正規表現検索を実行して、一致を変換文字列と置き換えます。$1 によって、変換文字列内でマッチング グループにアクセスできます。

{{issue.summary.replaceAll("(lo)","xx$1yy")}} -> Helxxloyy World!

For more information, see: String.replaceAll(String, String).

reverse()

Reverses the characters in the text string.

{issue.summary.reverse()}} -> !dlroW elloH

For more information, see: StringUtils.reverse().

right(int length)

Returns the characters, from the specified amount of characters, from the right of the text string.

{{issue.summary.right(6)}} -> World!

For more information, see: StringUtils.right(int).

rightPad(int length, String pad)

Adds characters to the end of the text string until the specified total number of characters is reached.

{{issue.summary.<br/>rightPadPad(14,"-")}} -> Hello World!--

For more information, see: StringUtils.rightPad(int, String).

split(String separator)

Splits the text and returns the word specified by the word's position in the text string.

{{issue.summary.split(" ").first}} -> Hello

For more information, see: String.split(String).

startsWith(String str)

Checks if the text string starts with the specified text, and returns true or false.

{{issue.summary.startsWith("World!")}} -> false

For more information, see: String.startsWith(String).

substring(int start)

Returns the characters after the amount of characters specified.

{{issue.summary.substring(7)}} -> orld!

For more information, see: StringUtils.substring(int).

substring(int start, int end)

Returns the characters at the positions specified.

{{issue.summary.substring(1,3)}} -> el

For more information, see: StringUtils.substring(int, int).

substringAfter( String separator)

Returns the text after the first occurrence of the given separator.

{{issue.summary.substringAfter("W")}} -> orld!

For more information, see: StringUtils.substringAfter(String).

substringAfterLast(String separator)

最後の指定区切り文字の後のテキストを返します。

{{issue.summary.substringAfterLast("o")}} -> rld!

For more information, see: StringUtils. substringAfterLast(String).

substringBefore(String separator)

1 つ目の指定区切り文字の前のテキストを返します。

{{issue.summary.substringBefore("W")}} -> Hello

For more information, see: StringUtils. substringBefore(String).

substringBeforeLast(String separator)

最後の指定区切り文字の前のテキストを返します。

{{issue.summary.substringBeforeLast("o")}} -> Hello W

For more information, see: StringUtils. substringBeforeLast(String).

substringBetween(String open, String close)

指定されたパラメーターに挟まれるテキストを返します。

{{issue.summary.substringBetween("e","d")}} -> llo Worl

For more information, see: StringUtils. substringBetween(String, String).

toLowerCase()

Converts the text string to lower case.

{{issue.summary.toLowerCase()}} -> hello world!

For more information, see: String.toLowerCase().

toUpperCase()

Converts the text string to upper case

{{issue.summary.toUpperCase()}} -> HELLO WORLD!


For more information, see: String.toUpperCase().

trim()

値の始めまたは終わりにある空白を削除します。

{{issue.summary.trim()}} -> Hello World!

For more information, see: String.trim().

urlEncode()

Encodes text to allow them to be included as a URL param, for example, a link in an email.

{{issue.summary.urlEncode}} -> See Encoding below.

xmlEncode()

Encodes text to allow them to be included in XML data, for example, an outgoing webhook.

{{issue.summary.xmlEncode}} -> See Encoding below.

エンコード

When integrating with other systems or sending emails, you may need to encode the text to comply with standards or not break things. For example, if you are sending an HTML email, you may need to encode an issue's description as HTML. This escapes specific characters to comply with the HTML specifications.

HTML エンコード

HTML encoding is useful for emails and exporting HTML pages. For example, Waiting for R&D would be encoded as Waiting for R&amp;D.

// Function
{{#htmlEncode}}{{issue.status.name}}{{/}}

// Inline version
{{issue.status.name.htmlEncode}}

JSON エンコード

Useful when sending outgoing webhooks as JSON. For example, "Hello World" would be encoded as \"Hello World\".

// Function
{{#jsonEncode}}{{issue.summary}}{{/}}

// Inline version
{{issue.summary.jsonEncode}}

URL エンコード

Useful when sending creating links in emails. For example, Hello & World would be encoded as Hello%20%26%20World.

// Function
{{#urlEncode}}{{issue.summary}}{{/}}

// Inline version
{{issue.summary.urlEncode}}

XML エンコード

Useful when sending Outgoing webhooks as XML. For example, Hello & World would be encoded as Hello &amp; World.

// Function
{{#xmlEncode}}{{issue.description}}{{/}}

// Inline function
{{issue.description.xmlEncode}}
最終更新日 2021 年 9 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.