You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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 Mae Gador
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Danisse Mae Gador 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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.