Workflow Runscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 08:12 AM
Hi all,
I have a requirement where in I need to auto populate a certain variable value on the task based upon the value from the asset table.
The display name of the asset has to be populated on the variable of task, once the purchase order is received of the procurement.
To achieve this I have created a run script before the task creation in the workflow,
The run script is below,
var gr = new GlideRecord('alm_asset');
gr.addQuery('request_line',current.sys_id);
gr.query();
if(gr.next())
{
current.variable_pool.variable to be updated on task = gr.dispay_name.getDisplayValue();
}
Here the variable to be updated on the task is in the variable set, hence I have put in variable_pool in the script.
The variable we are trying to update is also present on the RITM and also on the catalog task.
But the run script is not updating the variable on the task. Can anyone help me in finding what else needed to be done on this requirement.
Thanks,
Kamal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 11:09 AM
Why is your run script not working? May be the asset doesn't exist when the run script is running.
Do you wait, until asset is created? If yes, then i would recommend adding 'wait for condition' for asset to get created. And once the asset is created, you update the variable. This activity can be in parallel to your catalog task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 11:14 AM
thanks,
Let me try and i will get back to you..
Thank you