- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 04:36 PM
Hi all,
I need to set the short description of the tasks created via a certain catalog item to be the catalog item name + a variable (user's name). I know this can be done in the workflow but I don't want to make any changes there as it's being used with all the catalog items. I've created a before insert business rule with the condition:
current.cat_item == gs.getProperty('new.joiner')
And the script is:
(function executeRule(current, previous /*null when async*/ ) {
sc_task.short_description = current.cat_item.name + current.variables.joiner_name;
})(current, previous);
But it doesn't work. Currently, the short description of the tasks is set to something else and I can't figure out where this is configured - I've checked the workflow, the dictionary, catalog client scripts, business rules. So my business rule either doesn't work, or is overriden by the current config. Any ideas on how to solve this?
Thanks
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 05:09 PM
Try to use below code
Condition should be
current.request_item.cat_item == gs.getProperty('new.joiner')
(function executeRule(current, previous /*null when async*/ ) {
current.short_description = current.request_item.cat_item.name + current.request_item.variables.joiner_name;
})(current, previous);
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 04:55 PM
Can you tell on which table you have written the BR?
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 05:07 PM
Hi Saurabh, it's on sc_task table. Should it be on sc_req_item? I didn't consider this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 05:09 PM
Try to use below code
Condition should be
current.request_item.cat_item == gs.getProperty('new.joiner')
(function executeRule(current, previous /*null when async*/ ) {
current.short_description = current.request_item.cat_item.name + current.request_item.variables.joiner_name;
})(current, previous);
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 05:14 PM
Amazing, thank you for this! It makes sense why mine wasn't working 🙂