Can I pull individual names from a list collector for task short description

James Turney
Tera Contributor

Hello All,

 

 I have a request for set up with a list collector pointing to the user table. Depending on the number of users selected in the variable the request will generate the same number of tasks. I want to put each individual name in the task short description but am struggling. 

 

Here is the current variables I have for the form.

JamesTurney_0-1700165848750.png

 

I have a run script in the workflow that generates the tasks, it will fill in most of the short description but no matter what I try it doesn't give a name. I have managed to pull the SSIDs and display but instead of it showing just 1 name it shows ALL names that were selected. 

 

JamesTurney_1-1700165937601.png

 With the script set up how it currently is the request generated the correct number of tasks but shows this for short description. All correct just not showing a name. Any ideas on what I'm doing wrong or how to accomplish this? This is the last piece I need to solve for this form to go live. 

JamesTurney_2-1700166000135.png

 

 

1 ACCEPTED SOLUTION

Tom Siegel
Kilo Guru

I would try putting some logging in your script to spit out the ci.name. Start on line 9, see if you are getting any value. Something like gs.log("CI Name: "+ci.name); If you are getting a value make sure you are passing it properly on line 13. For instance the name field on the cmdb_ci table is a string value. So if you find you are getting a value make sure you are passing as a string ci.name.getDisplayValue(); or ci.name.toString();

View solution in original post

2 REPLIES 2

Shubham Singh
Mega Guru

Hi @James Turney 

 

As you mentioned, your list variable is referring to sys_user table then why are you running the GlideRecord on cmdb_ci table.

 

Also print a log after line 2 and check if you’re getting sys-ids of all the users in options.

 

Thanks!

 

Please mark this response as correct and helpful if it works ✔️👍

Tom Siegel
Kilo Guru

I would try putting some logging in your script to spit out the ci.name. Start on line 9, see if you are getting any value. Something like gs.log("CI Name: "+ci.name); If you are getting a value make sure you are passing it properly on line 13. For instance the name field on the cmdb_ci table is a string value. So if you find you are getting a value make sure you are passing as a string ci.name.getDisplayValue(); or ci.name.toString();