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

Joshua_Quinn
Kilo Guru

Hello @Sylvain12 ,

 

I would recommend checking your Assignment Rules in your system to ensure that they are not redirecting the record to the default assignment group.

 

Additionally, check that your scripts you are writting are using

current.assignment_group = <sys_id_of_group_b>

Instead of Group B's display name.

Finally, within the workflow, if you are trying to set the assignment group of the ticket on creation, it will go to the default group on creation, then run the workflow, and should set the group in that node of the workflow. But in a Catalog Task Node on a workflow, you should be able to just enter the assignment group in the "Fulfillment Group" field on the Catalog Task Node.

Thank you all for your prompt replies !

 

I found Assignment Rules related to group assignment but none are related to my groups.

 

And using sys_id instead of group name in scripts is also not working unfortunately...

Can you share the script that you are using? Are you doing these scripts on a workflow node or in a BR?

Thanks!

I tried on workflow node "Catalog task" (task creation node), with below code:

task.assignment_group = 'sys_id of the group';

I also simply tried with "set values" of "Populate task variables" section, but default value is remaining...

 

I also tried with BR:

After Insert and Update, condition = task description field content

I used "Actions" tab and also below script:

current.assignment_group="sys_id of the group";