0

I'm using XplatGenerateReleaseNotes plugin for my release notes.

I want to handle my #if that recognizes when a custom field is empty. I found in the plugin source code that there is a helper called "isEmpty", but I can't get it to work.

Here is my template:

{{#return_parents_only this.workItems this.relatedWorkItems}}
{{#if (or (contains (lookup this.fields 'System.WorkItemType') 'User Story') (contains (lookup this.fields 'System.WorkItemType') 'Feature'))}}
{{#if (isEmpty (lookup this.fields 'Custom.ReleaseNotes'))}}
emtpy
{{else}}
{{#with fields}}
* **{{{get 'System.Title' this}}}:** {{{sanitize (get 'Custom.ReleaseNotes' this)}}}
{{/with}}
{{/if}}
{{/if}}
{{/return_parents_only}}

Any ideas?

  • Where does the `isEmpty` helper come from? – 76484 Sep 26 '22 at 03:06
  • https://github.com/helpers/handlebars-helpers#isempty I was thinking about using the lengthEqual to check if the length of the given field is 0. – Froostx Sep 27 '22 at 02:35
  • Yes, the `isEmpty` documentation says it takes a collection. Assuming your target value is a string, I think the [equalsLength helper](https://github.com/helpers/handlebars-helpers#equalslength) would be a good choice. – 76484 Sep 27 '22 at 03:27

0 Answers0