Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy 255 Characters only in Text field (single-line) custom field from Issue Comment

Digvijay Singh
Contributor
April 8, 2025

Hi Community 

I have a specific requirement where I want to copy 255 characters only in custom text field (single-line) from last comment of the issue.

For example, a new comment is added to issue which contains more than 255 characters

but in custom single line text field, it should show only 254 characters (within limit) and reduct the remaining when coping the value from last comment. 

Please guide how I can achieve the above via jira automation or Additional fields using JSON or smartvalues for comments or scriptrunner behavior.

Please note: I want to avoid Rule Error as it can't exceed 255 characters and somehow, I want to copy the comment value in single-line text field instead of multi-line text field. 

Thanks

1 answer

0 votes
Nacho Moreno Ortega
Contributor
April 8, 2025

Hello Digvijay Singh,

I am Nacho and i am part of Decadis team.

If it is an option for you to use another app, this is something that can be achieved easily with our app Jira Workflow Toolbox Cloud.

For this purpose, an Update fields post function can be created with the following configuration:

  • Select the text field from the fields to be updated.
  • Select Set field value manually (parser expression).
  • Enter the following expression (using the parser function substring() to indicate the 255-character limit)
  • %{substring(%{issue.lastComment}, 0, 255)}

It should look like this:

Screenshot PF..png

If you have any questions or if the requirement needed is different, I encourage you to create a ticket in our Support portal and we will be happy to help you.

Best regards

Nacho

Digvijay Singh Gehlot April 8, 2025

Thank you @Nacho Moreno Ortega for your message and the third party app suggestion. I will explore it. 

Currently I am looking for existing jira automation functionality 

I tried this smartvalue

abbreviate(int maxLength)

And it worked for me. 

Now I want to pass hyperlink along with 255 characters which should contains current issue last comment url 

How should I pass last comment url of a current issue in single line text field along with 255 characters limit? 

Thanks

Suggest an answer

Log in or Sign up to answer