
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 11:01 AM
Hi there,
We have a catalog item and all records being created contain a generic title (short_description) that was originally added when the item was created. This is problematic because in our list view it has become impossible to easily navigate through the requests. The form to create a request includes form variables including a field for 'What are you requesting? (what_are_you_requestion)' that displays information on the request details page. I have been trying to create a script to populate the Short Description with this variable but have not been able to make it work.
The are some of the things I have tried...
Within the workflow, I added a script to the Activity Properties: Catalog Task:
task.short_description = current.variables.what_are_you_requesting;
I also tried adding a Run Script with the following:
var gr = new GlideRecord('sc_cat_item');
gr.addQuery('sys_id', current.cat_item);
gr.query();
if (gr.next()) {
gr.short_description = current.variables.what_are_you_requesting;
gr.update();
}
My last attempt was to create a Business Rule. I tried both async and before insert/update hoping new records could include a title. I have tried a few script variations but this is my most recent:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if (current.name == 'Generic IT Request') {
current.short_description = current.variables.what_are_you_requesting;
}
})(current, previous);
I have been struggling to come up with a solution for this and appreciate any advice. Cheers!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 11:06 AM
Hi,
I'm trying to understand WHAT record...are you trying to change the short description? Because some of your attempts look like you're trying to change the task short description...then others...it's the RITM short description.
If you're trying to change the RITM short description...and this workflow runs on the RITM table...then you should be able to easily change the short description using something like this in a run script activity:
current.short_description = current.variables.what_are_you_requesting.toString();
But all of this is assuming that 1) you're running this workflow on the RITM table and 2) The name of your variables...is correct...so check that.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 11:06 AM
Hi,
I'm trying to understand WHAT record...are you trying to change the short description? Because some of your attempts look like you're trying to change the task short description...then others...it's the RITM short description.
If you're trying to change the RITM short description...and this workflow runs on the RITM table...then you should be able to easily change the short description using something like this in a run script activity:
current.short_description = current.variables.what_are_you_requesting.toString();
But all of this is assuming that 1) you're running this workflow on the RITM table and 2) The name of your variables...is correct...so check that.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 12:41 PM
Thank you so much for this. I was so close to making this work and had tried an almost identical script without the toString method. Cheers!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 12:59 PM
Hi,
You're welcome. Please mark my reply as Correct, above. Currently, you have marked your own as Correct.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2019 01:32 PM
Thanks! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!