Hello,
Can somebody help with the inline or block condition in the "Description field"?
I understand this is not an ideal solution, but what we are trying to achieve is to return fields that are not empty to the Description field. The information is collected from the form with conditions like if this is a field, the user must fill in this additional information.
Problem: Fields enclosed in the condition return empty even though the field contains a value. I tried using function .exist, but that doesn't help.
*Název / Working title:* {{issue.summary}} *Priorita / Priority:* {{issue.priority.name}} *Termín / Deadline* {{issue.dueDate.mediumDate}} *Tvé jméno / Your name* {{issue.reporter.displayName}} *Co potřebuješ? / What do you need?* {{#issue.customfield_11734}} - {{value}} {{/issue.customfield_11734}} {{#if(not(issue.customfield_11735.isEmpty))}} *Komunikační kanály / Communication channels* {{#issue.customfield_11735}} - {{value}} {{/issue.customfield_11735}} {{/if}} {{#if(not(issue.customfield_11736.isEmpty))}} *Doplňující info / Additional details* {{#issue.customfield_11736}} - {{value}} {{/issue.customfield_11736}} {{/if}} {{#if(not(issue.customfield_11737.isEmpty))}} *Název kódu / Name of the code* {{issue.customfield_11737}} {{/if}} {{#if(exists(issue.customfield_11738))}} *Max. počet použití celkem* {{issue.customfield_11738}} {{/if}} {{#if(exists(issue.customfield_11739))}} *Max. počet použití na uživatele* {{issue.customfield_11739}} {{/if}} {{#if(exists(issue.customfield_11740))}} *Uveď všechny údaje na vizitku a počet kusů. / Enter the business card details and quantity.* {{issue.customfield_11740}} {{/if}} {{#if(exists(issue.customfield_11741))}} *Jaký formát potřebuješ? (.ppt, .pdf, .jpg a další) / What type of format do you need?* {{issue.customfield_11741}} {{/if}} {{#if(exists(issue.customfield_11742))}} *O co přesně se jedná? / Tell us what you need?* {{issue.customfield_11742}} {{/if}} *Cílová skupina / Target group* {{#issue.customfield_11731}} - {{value}} {{/issue.customfield_11731}} {{#if(exists(issue.customfield_11732))}} *Kdo? / Who?* {{issue.customfield_11732}} {{/if}} *CZECH Context & Background - Detailní zadání* {{issue.description}} *ENGLISH Context & Background - Detailed info* {{issue.customfield_10326}} *Kterých entit se to týká? / What entity does it concern?* {{#issue.customfield_11733}} - {{value}} {{/issue.customfield_11733}}
Thank you for any suggestions on how to solve this problem.
Hi @Patrik Štoural -- Welcome to the Atlassian Community!
Short answer: the isEmpty() function does not work for all field types and conditions as it is intended for text values. Experimentation is required to confirm what is needed.
First thing: the example you show is quite long and potentially complicated, making maintenance very difficult. I recommend breaking that up to determine the value for each field, storing the result in multiple Created Variables. Then the variables may be written to the audit log to check progress and combined for your final need (e.g., setting the Description field).
Back to your question...
For a text field, the isEmpty() function will work.
That will not work for other field types. For example, a multiple-select option field is a list, and so it may be better to check the number of elements selected with list functions: {{issue.myMultipleSelectField.value.size.eq(0)}}
Other fields have additional challenges. For example, the difference between empty, blank, and if the field previously had a value which was later cleared.
My recommendations are:
Test myMultipleSelectField with isEmpty: {{issue.myMultipleSelectField.isEmpty()}}
Test myMultipleSelectField.value with isEmpty: {{issue.myMultipleSelectField.value.isEmpty()}}
Test myMultipleSelectField.value.size: {{issue.myMultipleSelectField.value.size.eq(0)}}
Kind regards,
Bill
Hello,
Yea,h you are right.
The problem was in:
Incorrect Closing Tags: The use of {{/if}} instead of {{/}} resulted in parsing errors.
Improper use Of isEmpty:
*Název / Working title:*
{{issue.summary}}
*Priorita / Priority:*
{{issue.priority.name}}
*Termín / Deadline*
{{issue.dueDate.mediumDate}}
*Tvé jméno / Your name*
{{issue.reporter.displayName}}
*Co potřebuješ? / What do you need?*
{{#if(issue.customfield_11734.size)}}
{{#issue.customfield_11734}}
- {{value}}
{{/issue.customfield_11734}}
{{/}}
{{#if(issue.customfield_11735.size)}}
*Komunikační kanály / Communication channels*
{{#issue.customfield_11735}}
- {{value}}
{{/issue.customfield_11735}}
{{/}}
{{#if(issue.customfield_11736.size)}}
*Doplňující info / Additional details*
{{#issue.customfield_11736}}
- {{value}}
{{/issue.customfield_11736}}
{{/}}
{{#if(exists(issue.customfield_11737))}}
*Název kódu / Name of the code*
{{issue.customfield_11737}}
{{/}}
{{#if(issue.customfield_11738)}}
*Max. počet použití celkem*
{{issue.customfield_11738}}
{{/}}
{{#if(issue.customfield_11739)}}
*Max. počet použití na uživatele*
{{issue.customfield_11739}}
{{/}}
{{#if(exists(issue.customfield_11740))}}
*Uveď všechny údaje na vizitku a počet kusů. / Enter the business card details and quantity.*
{{issue.customfield_11740}}
{{/}}
{{#if(exists(issue.customfield_11741))}}
*Jaký formát potřebuješ? (.ppt, .pdf, .jpg a další) / What type of format do you need?*
{{issue.customfield_11741}}
{{/}}
{{#if(exists(issue.customfield_11742))}}
*O co přesně se jedná? / Tell us what you need?*
{{issue.customfield_11742}}
{{/}}
*Cílová skupina / Target group*
{{#if(issue.customfield_11731.size)}}
{{#issue.customfield_11731}}
- {{value}}
{{/issue.customfield_11731}}
{{/}}
{{#if(exists(issue.customfield_11732))}}
*Kdo? / Who?*
{{issue.customfield_11732}}
{{/}}
*CZECH Context & Background - Detailní zadání*
{{issue.description}}
*ENGLISH Context & Background - Detailed info*
{{issue.customfield_10326}}
*Kterých entit se to týká? / What entity does it concern?*
{{#if(issue.customfield_11733.size)}}
{{#issue.customfield_11733}}
- {{value}}
{{/issue.customfield_11733}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well done, and just an FYI...
exists() checks for null (or not null) and isEmpty() checks for blank (or not blank). That second one usually returns the same result for text fields, but for other fields testing is required.
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.