Skip to content

Handle empty fields #412

Open
Open
@Froostx

Description

@Froostx

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. Maybe the helper.isEmpty doesn't work for strings?

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 will be very helpful :)
thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions