自動化スマート値 - 条件ロジック
The smart values listed on this page can be used with actions where text fields are involved, such as the Add comment or Send email actions. They can be used to print outputs based on conditional logic such as if
or and
statements.
_
構文
{{if(smartValue)}}
は true または null を返します。{{if(“string”)}}
は true または null を返します。{{if(smartValue)}}Hello{{/}}
returns Hello or null.{{if(smartValue, “Hello”)}}
returns Hello or null.{{if(smartValue, "value if true", "value if false")}}
では、条件が一致しない場合に特定の値を追加できます。
例
Let’s say you have a list of issues (perhaps from a Lookup issues action), and you want to add a comment to any that have linked issues. You could use the Add comment action with the following input to add a comment to each issue that has at least one linked issue:
{{#if(not(issue.issuelinks.isEmpty))}}
This bug has {{issue.issuelinks.size}} related tickets
{{/}}
In this case, if an issue has 4 related issues, then the comment This bug has 4 related tickets would be added.
指定の値に等しい
構文
{{equals("string1", "string2")}}
は、2 つの入力が等しい場合はtrue
を、そうでない場合はfalse
をそれぞれ返します。{{equals(smartValue1, smartValue2)}}
は、2 つの入力が等しい場合はtrue
を、そうでない場合はfalse
をそれぞれ返します。
例
Let's say you have a process in your team, whereby the assignee and the reporter must be different team members for auditing purposes. You could use the Add comment action with the following input to add a comment to each issue to remind your team that this is the case:
{{#if(equals(issue.assignee, issue.reporter))}}
Assign this issue to someone else so they can review.
{{/}}
This would add the comment Assign this issue to someone else so they can review if the assignee and reporter are the same.
存在する
構文
{{exists(smartValue)}}
は true または null を返します。{{exists("string")}}
は true または null を返します。
例
Let's say you have a custom field on your issues called Designer. You could use any action that prints text (such as Add comment, or Send Slack message) to inform people with the following input:
{{#if(exists(issue.designer))}}
The designer for this issue is {{issue.designer.displayName}}
{{/}}
In this case, if the field Designer has a value, your output would be The designer for this issue is (designer's name).
NOT
構文
{{not(smartValue)}}
は true または false を返します。
例
Let’s say you have a list of issues (perhaps from a Lookup issues action), and you want to add a comment to any that have linked issues. You could use the Add comment action with the following input to add a comment to each issue that has at least one linked issue:
{{#if(not(issue.issuelinks.isEmpty))}}
This bug has {{issue.issuelinks.size}} related tickets
{{/}}
Here, the not smart value checks to see if an issue has at least one related issue. For example, if an issue has 4 related issues, then the comment This bug has 4 related tickets would be added.
および
構文
{{and(smartValue1, smartvalue2)}}
は true または false を返します。
例
Let's say you have a list of issues that have a Votes custom field. You could use the Add comment action to add a comment to all issues that have greater than 100 votes, and less than 150 votes:
{{#if(and(issue.Votes.gt(100),issue.Votes.lt(150)))}}
Moderately Popular issue
{{/}}
This input would add the comment Moderately Popular issue.
または
構文
{{or(smartValue1, smartvalue2)}}
は true または false を返します。
例
Let's say you've got a project that customers use to report bugs, and your issues have a Votes custom field. You could gather a list of issues using the Lookup issues action, and then use the Add comment action to add a comment to all issues that have either more than 100 votes, or more than 20 comments:
{{#if(or(issue.Votes.gt(100),issue.comments.gt(20)))}}
Heavily requested issue
{{/}}
Here, the if smart value checks for more than 100 votes or more than 20 comments, and adds the comment Heavily requested issue.
この内容はお役に立ちましたか?