Save last comment text in custom field

ariel_destefano
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 6, 2024

HI, sorry if this exists but i tried searching for it and i could not get the answer:

 

When i close the ticket, i want to save the last comment in a custom text field (my goal is to show this in a grid, its like a "closure comment" on the ticket:

 

i created a rule that updates the field using {{issue.comments.last.body}} or {{triggerissue.comments.last.body}}

 

It works! but it has 2 problems:

 

1. if the text is > 250, the rule returns an error. i can solve this with abbreviate:

{{triggerIssue.comment.last.body.abbreviate(255)}}

 

2. if the text is formatted, the saved text includes the formatting strings

{color:#1F497D}{color}....

 

Is there a way to directly save a plain text up to 255 characters of the last comment?

 

2 answers

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 6, 2024

Hello @ariel_destefano 

Welcome to the Atlassian community!

If you review the documentation on manipulating string/text smart values, you'll find information about "html renderer"

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#html-render

The link in that section leads to this page:

Convert wiki markup to HTML or plain text in Jira automation 

And that page says you can render Wiki as plain text by appending .text  to the smart value, i.e:

{{issue.comments.last.body.text}}

0 votes
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 6, 2024

Hi @ariel_destefano

welcome to the community!

I understand that you are planning to solve your use case using Automation, but just as food for thought: If you are open to solutions from the Atlassian Marketplace, there are apps that can help with this, too.

E.g., my team and I work on an app in which your use case would be easy to solve without any automation or scripting whatsoever, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of so-called smart columns that aren’t natively available, including the last comment, along with many other comment-related columns.

This is how it looks in action:

 last-comment.gif

As you can see above, you can easily sort and filter by the last comment; you can also use it across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

As said above, this just works - there is no automation or scripting whatsoever required.

Any questions just let me know,

Best,

Hannes

Suggest an answer

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

Atlassian Community Events