Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty fields #412

Open
Froostx opened this issue Sep 26, 2022 · 0 comments
Open

Handle empty fields #412

Froostx opened this issue Sep 26, 2022 · 0 comments

Comments

@Froostx
Copy link

Froostx commented Sep 26, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant