Hello.
I'm trying to generate a specification document from my R4J Tree and I'm facing a issue when, for each issue of the tree, I try to display and use the project of a linked issue : null exception in the generated document.
Here is the extract of my template that generates the issue :
[[\if $.linkedissues.count > 0]]Linked requirements:
[[\variable.link_requirement ‘TRUE’]][[/variable]]
[[\each $.linkedissues]]
[[\if $.name = “contributes to”]]
Contributes to “[[$.issue.summary]]” ([[$.issue.key]]) [[$.issue.project]]
[[\\wiki $.issue.description]] [[/wiki]]
[[\variable.link_requirement ‘FALSE’]][[/variable]]
[[/if]]
[[/each]]
[[\if $variable.link_requirement = ‘TRUE’]]
None.
[[/if]]
Thank for your help
[[\if $.linkedissues.count > 0]]Linked requirements:
[[\variable.link_requirement ‘TRUE’]][[/variable]]
[[\each $.linkedissues]]
[[\if $.name = “contributes to”]]
Contributes to “[[$.issue.summary]]” ([[$.issue.key]]) [[$.issue.project]]
[[\wiki $.issue.description]] [[/wiki]]
[[\variable.link_requirement ‘FALSE’]][[/variable]]
[[/if]]
[[/each]]
[[\if $variable.link_requirement = ‘TRUE’]]
None.
[[/if]]
[[/if]]
I tested this block of code that you have, and it does work. I just added a closing if block at the end.
If it's not working for you, there may be other parts of your template causing the null exception, so we'd need to have a look at your entire template.
If you require more assistance, our friendly support team will be happy to help!
Best regards,
Angelica
Thank for your help @Angelica Salazar
Here is my code :
```
[[\template issueDetails]]
[[\variable.project $.project]][[/variable]]
URL de l’exigence : [[$.url]]
Description |
[[\wiki $.description]][[/wiki]] [[\if $.description = “”]]Pas de description[[/if]] |
[[\if $.attachments.count > 0]]Pièces jointes :
[[\each $.attachments]]
[[/each]]
[[/if]]
[[\if $.linkedissues.count > 0]]Exigences liées :
[[\variable.link_requirement ‘TRUE’]][[/variable]]
[[\each $.linkedissues]]
[[\if $.name = “contributes to”]]
Contribue à l’exigence “[[$.issue.summary]]” ([[$.issue.key]]) |
[[\\wiki $.issue.description]] [[/wiki]] |
[[\variable.link_requirement ‘FALSE’]][[/variable]]
[[/if]]
[[/each]]
[[\if $variable.link_requirement = ‘TRUE’]]
Aucune.
[[/if]]
[[\variable.link_requirement ‘TRUE’]][[/variable]]
Autres liens :
[[\each $.linkedissues]]
[[\if $.name = “relates to”]]
Est liée à l’exigence “[[$.issue.summary]]” ([[$.issue.key]]) |
[[\variable.link_requirement ‘FALSE’]][[/variable]]
[[/if]]
[[/each]]
[[\if $variable.link_requirement = ‘TRUE’]]
Aucun.
[[/if]]
[[/if]]
[[/template]]
[[\each $selectedProject]]
[[\recurse $.folders]]
[[\levelheading $.name]]
[[\wiki $.description]][[/wiki]]
[[\recursehere]][[/recursehere]]
[[\variable.parent $.key]][[/variable]]
[[\recurse $.folderissues]]
[[\levelheading “(“ + $.issuetype + “) “ + $.summary]]
[[\apply-template issueDetails]][[/apply-template]]
[[\variable.project $.project]][[/variable]]
[[/levelheading]]
[[/recurse]]
[[/levelheading]]
[[/recurse]]
[[/each]]
```
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just copied your code into a Word document and tried to use it. It works fine for me. I am able to export without the null exception you mentioned.
Can you share the exact error you're experiencing?
Best regards,
Angelica
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.