Conditions for catalog task definitions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2023 10:56 PM
Please help with the conditions in the catalog task definition,
If the user country is Israel and the short description is something then the assignment group should be ITAM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2023 11:06 PM
HI @charushk ,
I trust you are doing great.
Please find the below reference code for the same.
(function executeRule(current, previous /*null when async*/) {
// Get the user's country
var userCountry = current.opened_by.country;
// Get the short description of the task
var shortDescription = current.short_description;
// Check if the user's country is Israel and the short description meets your criteria
if (userCountry === 'Israel' && /* condition for short description */) {
// Set the assignment group to 'ITAM'
var itamGroup = new GlideRecord('sys_user_group');
itamGroup.addQuery('name', 'ITAM');
itamGroup.query();
if (itamGroup.next()) {
current.assignment_group = itamGroup.sys_id;
}
}
})(current, previous);
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 12:49 AM
Need to add the condition in the catalog task definition of the catalog item