Details
-
Bug
-
Status: Waiting Approval
-
Medium
-
Resolution: Unresolved
-
Xray Cloud 7.4.0
-
None
-
None
-
Browser: Version 145.0.7632.76 (Official Build) (arm64)
Description
Description
When evaluating conditions on Jira comment bodies inside a Document Generator Excel template, string operations such as .contains() or .startsWith() fail if the comment contains line breaks.
The goal is to filter comments that contain QC5 and print them in a dedicated section.
Observed behavior:
- Works for comments like:
- QC5 without a line break
- QC5: Quality concern. No tests added so far
- Fails (comment is skipped) when the comment contains a line break after QC5, for example for the following cases:
- QC5 with a line\nbreak.
- QC5:\nABC
- QC5:\n1234
If the condition is replaced with an always-true expression, for example:
#{if (%{true})}
then all comments are rendered correctly, including those with line breaks.
This confirms:
- Rendering ${Comments[j].Body} works correctly.
- The issue only occurs when applying .contains() or .startsWith() on a multiline comment body.
Pre-conditions
- An issue with multiple comments.
- At least one comment:
- Contains QC5 on a single line.
- Contains QC5 followed by a newline.
Example failing template snippet:
#{for j=CommentsCount}
#{if (%{'${Comments[j].Body}'.contains('QC5')})}
${Comments[j].Body}
#{end}
#{end}
How to reproduce
- Create or open an issue.
- Add the following comments:
- QC5 without a line break
- QC5: Quality concern
- QC5:\nABC
- QC5:\n1234
- Use the above Excel template snippet.
- Generate the document.
Actual result/Attachments
- Comments containing QC5 with a line break are skipped.
- Single-line QC5 comments are rendered correctly.
- Replacing the condition with true renders all comments, including multiline ones.
Attachments:
- Excel template used for reproduction.[^QC5 Comments.xlsx]
- Sample generated report: [^Issues - 2026-02-19T144518.038.xlsx]
- One tab showing filtered behavior (multiline comments missing).
- One tab showing all comments using an always-true condition.
Expected result
String checks such as:
- .contains('QC5')
- .startsWith('QC5')
should behave consistently regardless of whether the comment body contains line breaks.
Multiline comments containing or starting with QC5 should be included in the output.
Version
- N/A
Workaround
N/A