How to auto populate / get variables from Catalog item to Catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 08:00 PM
Hello @Mark Roethof @Ankur Bawiskar @Ravi Gaurav @Lola B
This is a requirement for service catalog
I want to Auto populate the task form based on the data that user has filled in the request from.
Above mentioned is the request form .
And here below this is how a Cat Task from should look
How can i achieve this?
The data that has filled in request from should be auto populated in the task
and there are some more fields to be added
How can i achieve this ?
Its a urgent requirement!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2024 11:23 PM
Hi @abdullahkhan852
You can create a Record producer directly on Task table.
Or
You can create a Business Rule that triggers when a Catalog Task is created. This Business Rule will pull data from the Request Item (RITM) and populate the corresponding Catalog Task fields.
(function executeRule(current, previous /*null when async*/) {
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.request_item); // Getting the RITM associated with the task
if (ritm.isValidRecord()) {
// Example of copying data from RITM variables to task fields
current.short_description = ritm.variables.short_description;
current.description = ritm.variables.description;
// Add more mappings for custom fields and additional variables
current.u_custom_field = ritm.variables.u_custom_variable; // Example for custom field
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2024 11:34 PM
Hi @abdullahkhan852 ,
This requirement can be achieved by 2 ways.
1. you create record producer on same table with required fields.
OR
2. Create a script on submit of your request, which will eventually take the values submitted and will populate in task table. (Workflow / flow / BR ).