Set task short description dynamically via business rule

Amelie G
Kilo Expert

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

1 ACCEPTED SOLUTION

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

View solution in original post

5 REPLIES 5

Hi,

 

Could you please help me how to write dynamic short description for approvals i.e: for sysapproval_approver table.

 

eg: for an particular catalog item, we need to write dynamic short description on approval table.