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}}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem! If this answer helped, would you mind accepting it so others that come across it can easily move forward?
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.