While constricting an automated email, pertaining to an Epic, i am using the following to list all the sub tasks in the Epic to be part of the email being sent:
{{#subtasks}}
<a href={{url}}>{{key}}</a> - {{summary}} - {{url}} - {{assignee.displayName}}
{{/}}
this is working well, and the email include all of the subtask in a list.
now, what I like to do is to only add sub tasks which has a certain value as part of the sub task description.
have tried things like:
{{#subtasks}}
{{#if {{summary}}.contains("text")}}
<a href={{url}}>{{key}}</a> - {{summary}} - {{url}} - {{assignee.displayName}}
{{/}}
{{/}}
but that does not work.
any ideas?
Hi @Ofir Haun -- Welcome to the Atlassian Community!
You could use the indexOf() function to find the position of the text in the Summary. If it is not found, the value will be -1, and so that may be used for a comparison. Please adjust the example below for your scenario / specifics:
{{#issue.subtasks}}
{{#if(summary.indexOf("some text").gt(-1))}}{{key}}{{/}}
{{/}}
Kind regards,
Bill
Works like a charm!!
thank you Bill!
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.