- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 04:39 AM
Hi All,
I have a requirement in service catalog like If the service offering is set to 'XXX' the following 'AssetCtask:Deliver/Install IT equipment' task template should be deactivated. How it can be achieved?
Can we acheive it using OnSubmit Client Script?
Thankyou.
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 05:51 AM
I wrote a code on the Template Spawn hierarchy to make it work. It worked. Thankyou.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 03:56 AM
Hi
As per the author requirement, I do not see in his code where the check is made if the value of that variable is the one which he want to check.
So would suggest to use the code as shared below by me. And also the variable value will not be available in Trigger condition of the BR, so this may cause an issue with the BR running all the time I believe.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2022 03:43 AM
Hi,
What you can do here is Write a After Insert Business Rule on Requested Item table and use the script below:
BR Details:
Table Name : Requested Item
When: After Insert
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var getVariable = current.variables.VariableName; //Replace your service VariableName here
if(getVariable == 'Check for your value here'){
disableTemplate();
}
function disableTemplate(){
var gr = new GlideRecord('sys_template');
gr.addQuery('sys_id','Enter the Sys id of the template here');
gr.query();
if(gr.next()){
gr.active =false;
gr.update();
}
}
})(current, previous);
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 12:46 AM
Thankyou it does makes the AssetCtask template inactive in the backend. But I want the AssetCtask template get deactivated only for this condition and it should be active for other catalog items.
The AssetCtask template which is activated should only run and close the RITM. Based on the condition if service offering is XXX it should not run using AssetCtask:Deliver/Install IT equipment' task template and close the RITM. Thankyou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 01:28 AM
Thankyou it does makes the AssetCtask template inactive in the backend. But I want the AssetCtask template get deactivated only for this condition and it should be active for other catalog items.
The AssetCtask template which is activated should only run and close the RITM. Based on the condition if service offering is XXX it should not run using AssetCtask:Deliver/Install IT equipment' task template and close the RITM. Thankyou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 01:57 AM
Sure. You can handle this within the same Business Rule itself.
You just need to add a condition to your Business Rule which will ensure that the template gets deactivated only for this particular catalog item and not for all of them.
See Screenshot below where you need to add the conditions:
Item is Name of your catalog item
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke