Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Xporter Cloud 2.1.1
-
None
Description
Description
Javascript .search and .replace stopped working with Xporter.
Example for .search Javascript
How to reproduce
- Create a new issue and add a value ´test´ to a label field, for example, the Components field.
- Create a template with the following code that uses the .search Javascript filter.
Here´s an example:&{for issues|filter=%{'${IssueTypeName}'.equals('Story') && ‘${Components}’.search(‘test’)>=0}} ${Key} &{end}
- Export the template from the Issue Navigator
Actual result/Attachments
It should export the Story Issues that contain the ´test´ component and replacing the
Expected result
It doesn´t export any value.
Workaround
Use the .contains Javascript workarounds this issue:
Here´s the code with the workaround:
&{for issues|filter=%{'${IssueTypeName}'.equals('Story') && ‘${Components}’.contains(‘test’)}} ${Key} &{end}
Example for .replace Javascript
How to reproduce
- Create a new issue and add a value ´12345678´ to a field, for example, the Description field.
- Create a template with the following code that uses the .replace Javascript.
Here´s an example:%{var sum = Number(${Description}); var rounded = sum.toFixed(2); var currency = "$" + rounded.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); currency} ${sum}
- Export the template from the Issue Navigator
Actual result/Attachments
It should apply the Javascript and export it.
Expected result
It doesn´t export any value.
Workaround
Removing the replace from the Javascript and use another kind of Javascript like for example the .indexOf is working.
Version
- 2.1.1