- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 06:25 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 09:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 07:54 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 08:03 AM
There are 3 BR on sc_task table, but none seems to affect my catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 07:56 AM
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";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 08:06 AM
Just tried it, behavior is the same unfortunately
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 06:32 AM
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.