- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:15 AM
i want to update short description i use run script . Request item short description was update. but reimaging RITM and Sctask not updated i used below script could please help me this
variable type is : select box
var temp = current.variables.application_being_requested.getDisplayValue();
var requested_by = current.variables.requested_by.getDisplayValue();
var request = new GlideRecord('sc_request');
request.get(current.request);
request.query();
if (request.next()) {
if (temp == "version1")
{
request.short_description = "version1"+requested_by;
request.update();
}
else if(temp == "version2")
{
request.short_description = "version2"+requested_by;
request.update();
}
else
{
request.short_description = "version3"+requested_by;
request.update();
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:29 AM
where are you writing the script?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:38 AM
Hi,
Hope you are creating catalog task from the Workflow. Open the Catalog Task activity inside the workflow and perform the following action:
1) Check Advanced Checkbox
2) Add below script inside Advances script:
var temp = current.variables.application_being_requested.getDisplayValue();
var requested_by = current.variables.requested_by.getDisplayValue();
if (temp == "version1")
{
task.short_description = "version1"+requested_by;
}
else if(temp == "version2")
{
task.short_description = "version2"+requested_by;
}
else
{
task.short_description = "version3"+requested_by;
}
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:40 AM
in case you are writing the script in workflow catalog task activity to set task short description then script shared by @palanikumar should work fine.
Please try that.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:38 AM
Hi,
Hope you are creating catalog task from the Workflow. Open the Catalog Task activity inside the workflow and perform the following action:
1) Check Advanced Checkbox
2) Add below script inside Advances script:
var temp = current.variables.application_being_requested.getDisplayValue();
var requested_by = current.variables.requested_by.getDisplayValue();
if (temp == "version1")
{
task.short_description = "version1"+requested_by;
}
else if(temp == "version2")
{
task.short_description = "version2"+requested_by;
}
else
{
task.short_description = "version3"+requested_by;
}
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:42 AM
I can add above script in catalog then no need write run script in workflow ??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 06:56 AM
The above script to be added in the workflow. You need to add this under the advanced script of Catalog Task Activity (the activity in workflow where you create the catalog task). Refer the below image for more details
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 08:09 AM
Wrapped ConversionError The Undefined value has no properties //Set values for the task in this script. Use the variable task when setting additional values. // Note: This script is run after the task values are set using the Fields, Template or values you have specified. /// For example:// task short description=current short description; var temp current variables.select_version.getDisplayValue); var requested by
current variables requested by getDisplayValue(); if (temp "Microsoft Project Access Request Form-WGL task short description "Microsoft Project Access Request Form WGL requested by; else if(temp Microsoft Visio Access Request Form" task short description Microsoft Visto Access Request Form" requested by else T task short description "Microsoft Visual Studio Pro Access Request Form-requested by line 6) (sys script include 3656ca608016600069528aeeSafth script
line 114
Databus Ouput
Condition Awes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 08:09 AM
After use that script I got this error