- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 10:47 PM
Hi.
In the past, I created a script that automatically added the value of a variable as an additional comment when a case was filed.
I tried to create a script with the same requirements after a long time, but I forgot it...
Can someone please help me create a script?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 11:40 PM - edited 04-14-2024 11:41 PM
Your record producer script is quite close, you just have a typo, you have written curent when it should actually be current. There is also no need for the line var comments; as this variable is not being used.
On a side note, your newline characters should written using \n not /n.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 11:25 PM
Hi @shibasou
Use insert business rule, simple script for copying variable value into additional comment--->
var theVariableValue = current.your_variable_name.toString();
// Check if the variable has value
if (theVariableValue) {
// Adding the variable’s value as an additional comment
current.comments = "Additional Comment: " + theVariableValue;
}
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 11:35 PM
Hi @shibasou ,
You can refer below script for reference
var additionalCommentRP = workflow.scratchpad.<variable_name>.toString();
current.comments = additionalCommentRP;
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 11:40 PM - edited 04-14-2024 11:41 PM
Your record producer script is quite close, you just have a typo, you have written curent when it should actually be current. There is also no need for the line var comments; as this variable is not being used.
On a side note, your newline characters should written using \n not /n.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 12:04 AM
Thank you! It went well!