Forums

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

Capture all the External Comments to a new Custom Field

BG Pantaleon
Contributor
January 25, 2023

Is it possible to capture a comment that is added by the customer in the portal and store it in another custom field? 

Requirement: 

  • Custom field "Notes" will be appended by new the Comment. Existing data would not be overwritten.
    • Example: A customer posted a new comment "Comment 2" and there is already existing "Comment 1" in the Notes field. 
      • Output should be Comment 2, Comment 1
  • Only Customer Comment (external) will be added on the Custom field "Notes"

 

This is what I have but it keeps overriding the Notes field with the new comment.

 

Screen Shot 2023-01-25 at 1.48.33 PM.png

1 answer

1 accepted

1 vote
Answer accepted
Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2023

Hi @BG Pantaleon

You should try using the 'concat' method for appending the string smart values.

In your case, in the 'Edit issue' and for 'Notes' field, you can try like:

{{issue.customfield_xxxx.concat(issue.comments.last.body)}}

Where 'customfield_xxxxx' is the custom field id of 'Notes' field.

Please refer to this article as well:

https://confluence.atlassian.com/automation/jira-smart-values-text-fields-993924863.html

Hope this helps.

Thanks,
Vamsi

BG Pantaleon
Contributor
January 25, 2023

@Vamsi Kandala this one works!

 

My only issue is how can I add a space on each of the Comment?Screen Shot 2023-01-25 at 2.41.18 PM.png

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2023

Hi @BG Pantaleon

You can add space or any string values using 'concat' method.  You just have to use 'contact' multiple times accordingly for each string to be appended.

Thanks,
Vamsi

BG Pantaleon
Contributor
January 25, 2023

@Vamsi Kandala - sorry I don't get it. Do you have a sample?

 

Thanks!

BG

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2023

Hi @BG Pantaleon ,

If you take your example:

  • Custom field "Notes" will be appended by new the Comment. Existing data would not be overwritten.
    • Example: A customer posted a new comment "Comment 2" and there is already existing "Comment 1" in the Notes field. 
      • Output should be Comment 2, Comment 1

Then in the 'Edit issue' and for 'Notes' field, you can try like:

{{issue.customfield_xxxxx.concat(issue.comments.last.body).concat(", ")}}

Where 'customfield_xxxxx' is the custom field id of 'Notes' field.

Note that I have added two 'concat' methods here.  One for appending the last comment and the other for appending ', ' (or any string you prefer).

If this is not what you are looking for, please send me the expected output.

Hope this helps.

Thanks,
Vamsi

Suggest an answer

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

Atlassian Community Events