- 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-25-2023 03:43 AM
Hello Joshua,
I checked the group sys_id and it is the expected one.
I looked into business rules, but didn't find anything related to this group assignement so far...
I don't know about u_catalog_item , but I added task.description = 'this is a test'; in the node, and it's not working either.
How can I catch the log related to this node ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 09:14 AM
Finally it works with the workflow node...
I think the u_catalog_item line of code was the issue...
Sorry for making you spending time on this and thank you very much for your strong support !
Kr,
Sylvain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 08:14 AM
Can you try with any of those again and then look at the audit table for that task? I'm curious if the assignment group is getting set properly and then being changed back to the default or if it is never being set properly to begin with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 07:36 AM
It seems that there is some criteria defined in the assignment group field, so there are some groups which are available for selection based on some criteria and your assignment group not fulfill that criteria(might be it is related to group Type or something else),
Can you check manually, have your group presented in the list while manual selection on form? if not please check is there any reference qualifier applicable on the assignment_group field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2023 07:43 AM
While manually selecting the group directly in the reference field, I can select the desired group and also after saving the task and reloading form the desired group remains.