I have some fusion processes where, under certain conditions, multiple Role IDs for the Project Manager (PM) are being added to specific tasks. I’ve tried various approaches, but I haven’t been able to successfully deduplicate the Task RoleID field to prevent duplicate roles from appearing. I cannot get he deDuplicte function to work.
Any advice or guidance on how I can address this would be greatly appreciated!
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
I've tested this in Fusion - the assignment works whether one or more options in the custom form are checked. Let me know!
Views
Replies
Total Likes
Hi John,
as you already wrote, deduplicate() is an array function.
In your setup, you are trying to deduplicate the field roleID, which stores a single value only. So this will not work as expected.
You are probably wondering why the field only saves a single value when it is possible to assign several roles to a task.
As I understand it so far, there is a historical reason for this. The option of ‘multiple assignments’ has probably not been around for that long.
So today, assignments are stored into a different database table and connected to the task as a collection.(https://developer.adobe.com/workfront/api-explorer/)
Back to your issue: I am not really sure, if you will be able to find an easy solution, but perhaps I did not really get the point.
As roles are objects in Workfront as well, they all have an unique ID. I am quite sure, that it does not happen, that an ID is assigned multiple times to the same task.
So, I suggest, that you have different job roles with the similar name...? As each role object has a different ID, the deduplicate() function would be of no use anyway. Finding a solution here could be quite a bit more difficult, as you would need different steps.
But before going into detail (not tested), I need to understand the issue better.
Regards
Lars
Views
Replies
Total Likes
Thanks @lgaertner
I’ve decided to take a different approach since there doesn’t seem to be a clear solution for my issue. The challenge I’m facing is that I need to assign up to 5 different roles to a single task, as per my client’s request. These roles are selected via a multi-select custom form field, and the value for each is a ROLE ID.
The issue is that the module won’t allow me to write logic that adds either the ROLE ID or a null value without triggering an error. I tried creating an IF statement to pull in the ROLE ID where applicable and insert a default value if it wasn’t selected, thinking I could deduplicate the results later. However, the deduplication function didn’t work as expected.
I’ve attached a screenshot below for reference.
Views
Replies
Total Likes
Hi @JohnMi
in your module you SET values. You can't "deduplicate" here against the already-assigned roles.
In addition: If role X is already assigned and you again assign role X - WF is smart enough to handle that so there's really no need to de-duplicate.
Comments
- you shouldn't use your personal WF account to do Fusion calls; instead, create a Fusion User
- you shouldn't assign the ROLE of a USER to a task. Either you assign a role (but why: You should be doing that in the template), or you assign a user based on his/her role.
Can you maybe explain more about exactly what the flow/logic is you're trying to implement in this scenario?
BTW: to do assignments there's a nifty assignMultiple action in the MiscActions module:
Views
Replies
Total Likes
@Sven-iX Thanks!
In regards to your Comments"
"- you shouldn't use your personal WF account to do Fusion calls; instead, create a Fusion User" - Not sure why this is the case, regardless I do not have a choice or say regarding that since it is my client's instance. If there is a documented reason, please let me know so maybe I can make the request.
"- you shouldn't assign the ROLE of a USER to a task. Either you assign a role (but why: You should be doing that in the template), or you assign a user based on his/her role." I do not understand. ROLES are ROLES and you create ROLES and apply them to USERS. Not sure why I would assign a ROLE that no USER is assigned to.
Views
Replies
Total Likes
I've tested this in Fusion - the assignment works whether one or more options in the custom form are checked. Let me know!
Views
Replies
Total Likes
@Sven-iX Thank you for both 1 and 2!
Views
Replies
Total Likes
Hey @JohnMi
I just noticed that if you were to assign users and leave roles blank - it also wants' an emptyarray in roles
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies