- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 12:26 PM
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.
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.
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 12:52 PM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 12:46 PM - edited 11-16-2023 12:47 PM
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 ✔️👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 12:52 PM
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();