Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Using R4J plugin, I'm unable to display the project field of a linked issueson a Word template

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

1 answer

0 votes
Angelica Salazar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 03, 2023

Hi @Laurent PIANFETTI

[[\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]]

```

Angelica Salazar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 07, 2023 • edited

Hi @Laurent PIANFETTI

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events