- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 12:01 AM
Hi ALL,
I have one Catalog Item 'Employee Name Change' and in that RITM form variables section I have two fields,
ie, New UPN and Email Address
and these 2 fields are filled by the assignee of the RITM if assignee is not filled these two fields at that time the sc_task which is created after the RITM approval that shouldn't be closed.
Could you please help me on this to get the proper solution.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2023 12:09 AM - edited 08-11-2023 12:16 AM
Hello @Mani60 ,
so you mean to say even if some one tries to close the catalog task they should not be able to close it if those fields are empty ?
if that is the case you can create a before update Business rule on sc_task table
where you condition can be like request_item.item is "your item name" AND state changes to closed complete
and in script you can check by using a simple glide record to ritm record tagged to your catalog task like below
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.request_item);
gr.query();
if(gr.next())
{
if(gr.variables.your_variable_1_name=="" && gr.variables.your_variable_2_name=="" )
{
current.setAbortAction(true);
}
}
Note :Above code is untested but you can give it a try
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
08-11-2023 12:09 AM - edited 08-11-2023 12:16 AM
Hello @Mani60 ,
so you mean to say even if some one tries to close the catalog task they should not be able to close it if those fields are empty ?
if that is the case you can create a before update Business rule on sc_task table
where you condition can be like request_item.item is "your item name" AND state changes to closed complete
and in script you can check by using a simple glide record to ritm record tagged to your catalog task like below
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id',current.request_item);
gr.query();
if(gr.next())
{
if(gr.variables.your_variable_1_name=="" && gr.variables.your_variable_2_name=="" )
{
current.setAbortAction(true);
}
}
Note :Above code is untested but you can give it a try
Hope this helps
Mark my answer correct if this helps you
Thanks