I want to do this:
- issue.description.replaceAll("||" + myParam + "|.*", "aReplacementString")
This would replace a certain table row in the description. The row that begins with myParam in the first cell. A table row looks like this:
- ||Column1|Field A|FieldB|FieldC
But the problem is that you can't add strings together as a parameter (using the plus sign). You can append a string onto an existing value (using concat), but you can't prepend.
I considered using reverse/concat/reverse/concat, which looks ridiculous. Ultimately I did this:
- issue.summary.left(0).concat("\|\|").concat(myParam).concat("\|.*")
This is probably equally ridiculous. I'm using the first 0 characters of the summary (a field I know exists) to create a temporary variable I can use to create my regex. I'm using the server version of Jira so I can't create a variable. I'm not sure what the right way to do this is. Any help appreciated.