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

So it appears that you are able to set the value after the record is created but not on creation. Can you verify if there is an Before/After insert BR that is setting the assignment group?

There are 3 BR on sc_task table, but none seems to affect my catalog item

@Sylvain12 

 

In business rule can you please try this:

Make sure the business rule would be before-update 

 

current.assignment_group="sys_id of the group";

 

Just tried it, behavior is the same unfortunately

Prince Arora
Tera Sage
Tera Sage

@Sylvain12 ,

 

As the Assignment group is the Reference field, please make sure you have provided the sys_id of group instead of name 

 

 

current.assignment_group ="sys_id_of_groupB"; //not name

 

 

If my answer solved your issue, please mark my answer as  Correct & 👍Helpful based on the Impact.