
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 09:34 AM
I'm just starting out with scripting (advanced section of a task) and they give the example of: task.short_description = current.short_Description; I'm asuming short_description is a property of the task object?
Question 1: Where is the documentation showing all the properties available for a given object? I tried looking at the API reference (HERE) but I can't seem to find the task object and the associated properties.
Question 2: I see they used a keyword "current". Where do I find the list of keywords and what they mean? I assume "current" means the current associated catalog item but I'd love to see the documentation on it.
Thanks all.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:07 AM - edited 11-19-2022 10:07 AM
Based off your question I'm assuming this is inside of a workflow.
- You can look up the documentation for the GlideRecord object. Task/Current are just GlideRecord objects referencing a specific record on a specific table.
- This documentation provides details on current/previous. In the context of a catalog request and inside a workflow context, current is the sc_req_item record.
Please mark my answer as helpful/correct if it answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:21 AM
hELLO @Brian Hofmeiste ,
I am assuming that you might have seen this script in catalog task activity of the workflow
To answer your questions ,
Yes you are correct TASK AND CURRENT are the objects and they have several set of properties that we can use for different purposes while scripting .
But here when they said task.short_description here
TASK-->Is an object
short_description--> is the field available on the task form .If you open the catalog task form you can see the short description field and on the field name you can do a right click on it and click on show short description
So when you write task.short_description it means that you are accessing the short description value which is stored in that field on the form .With this syntax you can access any field on the form .But the syntax should be
"task.your_field_backend_name" ;
When it comes to current Object it is used to perform operations and to access fields on the current for which you are in .
Lets say you are on the incident form and you want to update the current form by updating the short description of the incident you can write like below
current.short_description="your_short_Description_Text";
current.update();
In your case you must be on the RITM form because your workflow should be on RITM table so current object refers to RITM table
so your code says
task.short_description =current.short_description; -->This says you are trying to copy the RITM short description to catalog task short description .
Usually current object is the most common objects used and you can refer this link for more explanation
Hope this helps
Mark my answer correct if this helps you
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:07 AM - edited 11-19-2022 10:07 AM
Based off your question I'm assuming this is inside of a workflow.
- You can look up the documentation for the GlideRecord object. Task/Current are just GlideRecord objects referencing a specific record on a specific table.
- This documentation provides details on current/previous. In the context of a catalog request and inside a workflow context, current is the sc_req_item record.
Please mark my answer as helpful/correct if it answered your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:19 AM - edited 11-19-2022 10:20 AM
This was really helpful, thank you. I'm trying to assign tasks to the owner of the catalog item. It looks like "Owner" is not part of the request item, it's only part of the catalog item that initiates the request item. How do I get to that data? I tried task.assigned_to = current.parent.owner; but that doesnt appear to be the right path.
Forgot to ask - is there a way to get "intelisense" or property/method autocomplete? I think that would help me understand what is available with each object.
Thanks @Elijah Aromola
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:25 AM
hello @Brian Hofmeiste you can check my below answer for more explanation and to answer your current question to access the owner please try this code
task.assigned_to = current.cat_item.owner;
because cat_item is the field on the RITM form which stores the catalog item name and owner is on the catalog item form
So you can dot walk like above
Hope this helps
Mark my answer correct if this helps you
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2022 10:32 AM
ah this is making sense now. So the cat_item is a column on the request item table I take it? Thanks again for your help.