Need to concate the string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 08:08 AM
Hi All,
I am working on the Schedule Script execution for creating a RITM in this I wrote a script it's working as expected. but I need to display two lines string and I am not able to concatenate the strings.
Please any one suggest me, how to do this
Thanks in advance,
Vinuth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 08:22 AM - edited 06-28-2024 08:42 AM
Hi @vinuth v,
Can you try first try using a swapping the forward slash for a back slash: \n
If that doesn't work, try using using <br/> instead of /n
Examples:
cart.setVariable(item, 'request_description', 'This is to Update Browsers, Windows & Drivers on Non-Prod xxxx' + '\n' + abc);
or
cart.setVariable(item, 'request_description', 'This is to Update Browsers, Windows & Drivers on Non-Prod xxxx' + '<br/>' + abc);
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2024 08:31 AM
Hi @vinuth v
If you want to get that worked you need change the field type from single line text to Multi line text. and then use the below code I have checked in my PDI it is working Fine.
createCart();
function createCart() {
var cart = new Cart();
var item = cart.addItem('c8dd800a1b367d14d7354157dc4bcb1c');
cart.setVariable(item, 'requester', 'e5159d97136b2b08c9dfb6076');
cart.setVariable(item, 'email', 'Mario.ddd@xxxxxxx.com');
cart.setVariable(item, 'request_title', 'Routine Task');
var abc = "1) https://dev.com/caselinesdevops/Aquarius/_wiki/wikis/Aquarius.wiki/444/Updating-the-DevOps-Pipelinet...";
var description = 'This is to Update Browsers, Windows & Drivers on Non-Prod xxxx'+'\n' + abc;
cart.setVariable(item, 'request_description', description);
var rc = cart.placeOrder();
}
Thanks and Regards
Sai Venkatesh