Task | Assignement group field update

Sylvain12
Tera Contributor

Hi Everyone,

 

I want to modify the value of "Assignment group" task field of a catalog item, depending on a variable value of the catalog.

For example, if the variable = a, "Assignment group" of the task field is the default value "Group A".

if the variable = b, then "Assignment group" value should be "Group B".

 

However, no matter what I tried (with workflow script, Business Rule, client script), with variable =b the value remains the default one "Group A".

In Workflow, I used following code under "Catalog task" activity:

task.assignment_group = "Group B";

This actually worked with the description field, but not with assignment_group...

 

In BR, I used following code:

current.assignment_group ="Group B";

This didn't worked at all even with description field. I also tried with "Actions tab"

 

With client script, the value is replaced with "Group B" on the form, but when I save and reload the form, default value is displayed again.

 

For information, I can't remove the "Assignement group" default value because it is mandatory at the task creation.

 

If someone has an idea how to manage this, I would be very thankfull !


Kr,

Sylvain

1 ACCEPTED SOLUTION

This all looks correct. Can you verify for me that the sys_id in the script is the sys_id of the group (take that sys_id, go to the sys_user_group table and add a filter for sys_id is <insert_sys_id> and make sure that the group you expect comes back). Also, my apologies, you are correct; you don't need the .update() within the workflow node. My mistake.

If that is working, then there has to be something (an assignment rule, business rule, etc) that is overwriting your value. Is the u_catalog_item value that you are setting in that script working? You can also check the system logs to see if there is an error when this node is being ran.

View solution in original post

21 REPLIES 21

Chandresh Tiwa1
Tera Contributor

Hi, should work fine with workflow. In the catalog task activity script section, add

if(current.variables.variablename == 'a')
{
task.assignment_group = 'sys_id of group A';
}
if(current.variables.variablename == 'b')
{
task.assignment_group = 'sys_id of group B';
}

Make sure to check there are no OnLoad catalog scripts in place by mistake. As you mentioned, default value is not going away.

 

Mark Solved if this works.

 

Regards,

Chandresh

Sylvain12
Tera Contributor

Other information, even using the "set values" in "Catalog task" activity in workflow is not working