Display data in new line

Ramya SL
Tera Contributor

Hi all,

 

My requirement is I need to set the short description field of REQ ticket as below

Short Description - new use account created

userid - xyz

start date - xyz

 

I wrote the code as below 

 

var grReq = new GlideRecord('sc_request');
grReq.get(current.request.sys_id);
//Replace your field and values as per the need.
grReq.request_state = 'Close Completed';
grReq.description = 'New User Onboarding';
grReq.short_description = 'New user account created' + '\n' + 'User Id- ' + current.variables.user_id + '\n' + 'Start Date-' + current.variables.start_date;
grReq.update();

 

but output is showing like this: 

Short Description: New user account createdUser Id- Kar.GRStart Date-2024-01-31

 

Can anyone help me to correct my code to fix this issue

2 ACCEPTED SOLUTIONS

_Gaurav
Kilo Sage

Hi @Ramya SL  
The Short Description is a kind of single-line text field containing more characters as compared to other single-line text fields.
You can use the description field for showing such content or else create a new short description field as Multi-line text field.

Please mark helpful if this resolves your query
Thanks

View solution in original post

piyushsain
Tera Guru
Tera Guru

@Ramya SL  

You can apply this code on Description field as it is Multi Line field. Short Description is single line field and no new line can be created on it

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

View solution in original post

2 REPLIES 2

_Gaurav
Kilo Sage

Hi @Ramya SL  
The Short Description is a kind of single-line text field containing more characters as compared to other single-line text fields.
You can use the description field for showing such content or else create a new short description field as Multi-line text field.

Please mark helpful if this resolves your query
Thanks

piyushsain
Tera Guru
Tera Guru

@Ramya SL  

You can apply this code on Description field as it is Multi Line field. Short Description is single line field and no new line can be created on it

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain