The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Using R4J plugin, I'm unable to display the project field of a linked issueson a Word template

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

Laurent PIANFETTI
November 2, 2023

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
November 3, 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

Laurent PIANFETTI
November 6, 2023

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 Champions.
November 7, 2023

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

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events