I'm trying to automate a way to copy the latest comment to a custom field. While it is working only want to get the last portion of the comment.
Hello @Danisse
It sounds like smart values may be the solution here. Here's a link to some of the text expressions available for use in smart values. I think you may find the right and substring functions to be the best use case for you.
In terms of grabbing the last portion of the most recent comment, you'll probably end up having a smart value that looks similar to this:
{{issue.comments.last.body.substring(7}}
or
{{issue.comments.last.body.right(50}}
Hi @Sam Nadarajan
My test comment ends with Project Name: Maya and I just want to retrieve the Maya part.
Attached is the screenshot of my current script
@Danisse looks pretty close! Can you try
{{issue.comments.last.body.substringAfterLast(":"}}
You may need to escape the quotes inside the substringAfterLast parameter because you are already inside a quoted string for customfield_13835.
Additionally, you should just be able to plug in this smart value in the field selection above this section, instead of configuring the JSON.
It looks like you're new here. Sign in or register to get started.