Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,203
Community Members
 
Community Events
184
Community Groups

Is there a way to get a portion of a comment on Jira?

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.

1 answer

1 accepted

3 votes
Answer accepted
Sam Nadarajan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

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}}

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

Sam Nadarajan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

@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. 

Hi Sam was able to resolve it :) Thanks much!

Sam Nadarajan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 04, 2023

No problem! If this answer helped, would you mind accepting it so others that come across it can easily move forward?

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events