Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira R4J word export template

Alan Foose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 5, 2022

Hi, 

We are using the Export Template feature to create Word documents with a summary of JIRA issues from R4J.

We are looking for a way to enhance the reports by finding/exporting comments in the issues which contain keywords.

We know we can export ALL comments...
[[\if $.comments.count > 0]][[\each $.comments]][[$.]][[/each]][[/if]]

Or the first comment added...
[[\if $.comments.count > 0]][[\wiki $.comments.item(0)]][[/wiki]][[/if]]


But we would like to dynamically identify and export interesting comments by any means necessary. Is there anyway to using wildcards or startswith() functions, etc to pattern match text in a comment?

For examples I would that would look something like one of these three options:

[[\if $.comments.count > 0]][[\each $.comments]]
    [[\if $. = "/*SomeKeyword/*"]][[$.]][[/if]]

    [[\if $. ~ "SomeKeyword"]][[$.]][[/if]]

    [[\if $.startswith() = "SomeKeyword"]][[$.]][[/if]]
[[/each]][[/if]]

1 answer

1 accepted

0 votes
Answer accepted
Bernhard Doleschel (Ease Solutions)
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.
July 5, 2022

Hello @Alan Foose ,

thank you very much for this great question and your interest in this feature.

Currently you can only find matching keywords by a full string compare, see if statement documentation .

We have a very few similar requests on making this more flexible, so to increase the likelihood for an an impletion is a little bit low right now. To increase please raise a feature request on our service portal.

Best regards

Bernhard from from Ease Solutions, the vendor of R4J. 

Alan Foose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 6, 2022

Thanks @Bernhard Doleschel (Ease Solutions) for your confirmation!

I had reviewed the suggested documentation. It was clearly written and helpful to get using this template export feature. If we cannot solve this another way we will raise a request.

 

I understand now that only full string compare is possible. There is just one point I was not clear on and could not get to work. If we knew the full string we wanted to match, is it even possible to do full string comparison on comments?

To test I created an issue and added just two comments, "ABCD" and "EFGH". I used this code hoping it would find a match on the first comment.

[[\if $.comments.count > 0]][[\each $.comments]]
    Matched - [[\if $. = "ABCD"]][[$.]][[/if]]
[[/each]][[/if]]

But instead this just outputs:
 Matched - 
 Matched - 

Edmer John Sarmiento July 8, 2022

Hello @Alan Foose

I'm Edmer from EaseSolutions, vendor of R4J plugin.

Let me share a sample export template which will display all issues. There's a separate section for the Issues which has the exact comments e.g. "ABCD" and "EFGH". I've also included the comment context items.

 

[[\each $selectedProject]]

[[\recurse $.folders]]

[[\recurse $.folderissues]]

[[\levelheading $.key + “ - “ + $. summary]]

[[\if $.comments.count = 0]] NO Comment. [[/if]]

[[\if $.comments.tostring = “ABCD”]] 

[[\each $.comments]]

Matched (ABCD):

[[$.author]]

[[$.created]]

[[$.updated]]

[[$.updater]]

[[/each]]

[[/if]]

 

[[\if $.comments.tostring = “EFGH”]] 

[[\each $.comments]]

Matched (EFGH):

[[$.author]]

[[$.created]]

[[$.updated]]

[[$.updater]]

[[/each]]

[[/if]]

[[/levelheading]]

[[/recurse]] [[/recurse]][[/each]]

If you need further support with your template customization, we'd be glad to help you at our service desk portal.

Best regards,

Edmer

Suggest an answer

Log in or Sign up to answer