I need to capture the body of a comment, but not the first line.
Is the a smart value way o do this please?
In Javascript, I would get the position of the line break and get the substring after that character positions.
I tried this and an alteration without the inner smart value {{}}, but not luck. Any help on how I could do this please:
{triggerIssue.comments.last.body.substring({{triggerIssue.comments.last.body.indexOf("\n")}})}}
Hello @AldoCauchiSavona ,
It depends on the Storage format of the comment and how the end of the line is represented.
You can get the body of a comment as HTML (VIEW, STORAGE, ...) and try to get the end of line tag/tags and then parse by it.
Thanks @Andrii Maliuta The comment body is being retreive via a smart value {{issue.comments.last.body}}, I currently use {{issue.comments.last.body.substringBefore("\n")}} to get the contents of the first line.
I can remove or rplace that line with an empty space, but need to know how to use a smart value as a parameter.
{{triggerIssue.comments.last.body.substring(triggerIssue.comments.last.body.indexOf("\n"))}} and neither {{triggerIssue.comments.last.body.substring({{triggerIssue.comments.last.body.indexOf("\n")}})}} doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Andrii Maliuta the smart values I replied with do not work.
Not sure what part of it I'm doing wrong.
Maybe somebody can spot the problem with how I'm writing the smart value please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@AldoCauchiSavona , not sure about smart values in this case, sorry :( I ususally work with VM or thymeleaf / HTML JS templates and do the approach described before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andrii Maliuta would you have a link so I can reaserch and find out more about the HTML JS templates approach which you use?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.