You are viewing limited content. For full access, please sign in.

Question

Question

Assign Task to Team "Assigned Tasks" using Dynamic Variable and Filter

asked on July 24, 2018

I'm halfway to to where I am trying to get with the Assign to Team based on variable. Currently I have a set-up where there are multiple teams, all of which contain a number of Forms Participants (Team Members). The process requested would be that the Task is assigned to a specific individual (Submitter) as an "Assigned Team Task", and the same task be assigned to the rest of the Team as an "Unassigned Team Task". This would allow the submitter to confirm the User Task, all while allowing for the members within that team to then have access to the task under their "Completed Tasks" after the submitter has confirmed. The filter I am using is as follows:

var submitter = team.findTeamMembersByUserName($util.getValue('Intake_Submitters_Username'));
var team = team.getAllMembers($util.getValue('Intake_Submitters_Team'));
$result = $util.union(submitter, team);

 

After running a test, I can get the assignment to all of the correct members, but I can't figure out a way to avoid them from going into the "Unassigned Tasks" without manual reassignment. I thought about creating a second User assignment, but if that were the case, someone who DID NOT submit the contract would be responsible for confirming the submission, and that just wont work. Any advice or suggestions are greatly appreciated. Thank you all for your time. 

 

TL;DR - Team Filter assigns Task into Team "Unassigned Tasks", and I need it to go into "Assigned Tasks" for a specific user within the Team, and "Unassigned Task" for the remainder of the Team.

0 0

Replies

replied on July 30, 2018 Show version history

Thank you for taking the time to wrote on this post! I've been able to make some progress on this, and I've actually implemented a workaround using the Forms SQL table. Since I'm applying data to the Forms Table (User Snapshot ID), this method is deemed unstable for any Forms update could possible break the current look-up rules. 

 

Bryce, while working on this I did have the chance to play with Team Filters and it seems as though you may be able to use them to accomplish your task. If you are using Team Roles the filer can be used to return only the users whom have the specific Role within the Team. One thing that wasn't really explained was that when you use the "Assign to Team based on Variable" you can still use the Filters you've created, you just have to type in the Filter's Name instead of selecting it from the Drop-down. Secondly, to create the filer you have to first select assign to Team, use the drop-down to create and save the filter. Then you can switch to Team based on Variable and type in the newly created Filter Name. Each filter is specific to the Team selected when you first create the Filter, so if there are multiple teams you'll have to create the same filer multiple times. (Using the same Filter Name helps with this.) In your case, you'd need to use the "Helper Methods" to refine your team into specific Users. So create an invisible Single Line on your form and use it as the token to house the Team Name (I used a SQL table to look-up the Current Username to resolve the Team Name). Within the Filter you'll need to use "findMembersByRole('RoleName'):" to return any users whom have the specified role within the Team and you can use the Helper methods to compare this result to other instances such as another team or another role. (This is useful in that you can compare the two lists and return the duplicate users, or non-duplicate users if your teams have a tiered Roles system). If your results at the end of the filter return a single user, then and only then will it directly assign the user task to that submitter, and based on the Team settings the task may or may not be visible to the rest of the team. 

Resource Link: https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/Forms/Content/Inbox-And-Teams/Creating-Team-Filters.htm#tabs-1

 

In my case, things were a bit different. My teams were based on departments of several different users all of which were participant licenses, and all of which shared the same role as Submitter. So for me, applying a filter would not narrow down my result to only 1 user. What I did to work around this was a bit more complicated. I had to create two workflows. The first workflow is initiated just as a user task was assigned to the submitter (Submission Preview). Since this user task is only assigned to the submitter I used a custom SQL lookup on the [cf_bp_worker_instances] table to locate the current Instance ID (Each time a User task is assigned this table is updated so it's important that this step is done just before the Team Assignment Task. Using the Instance ID obtained from the custom look-up I can then determine the OwnerSnapshot ID (this is the unique ID associated to the user for task assignments.) I write these tokens back into the business process so that I can carry them over into the next Workflow. Now, the submission is assigned to the Team based on a variable (Team Name of Submitter). The second Workflow then uses the previous Instance ID and references it to the Worker Instance ID on the [cf_bp_worker_instnc_to_resume] table (by now the SQL table has already updated its value so the prior Instance ID is now the ref_instance ID). I then write the Snapshot ID into the "owner_snapshot_id" column and I also update the "status" to a static number "5". This pat I'm not exactly sure why the 5 represents, but my best guess is that it tricks LF into thinking that it's a User Task instead of a Team Task. After this though the task is then directly assigned to the User (Submitter) and since I did the adjustment to the SQL table, it maintains it's assignment to the Team. Now in this case, the person who submitted to contract is also the same person who confirms the finalized/signed version, and once they press confirm the task is then placed in the Completed Tasks under the Team Task tab. This is also very useful in that it removes all the clutter of User Task history and provides a clean list view of all the completed contracts without having to disable to individual reporting. If this method is something you think you'd be interested in hearing more about (thought from your submission it seems this might not be the best option since you may be able to accomplish your goal using filters alone) I would be more than happy to provide media and detail my steps further for you.

1 0
replied on July 30, 2018 Show version history

I'd like to echo Stephen's  "Assigned Tasks" for a specific user within the Team question? 

 

I don't need to be able to also have it "Unassigned Task" for the remainder of the Team.  Although if it works this way I might play around with it.

But more importantly to me, is I'd like to assign task to specific Role (or user) inside a team.  So a starting form asks Department and I'd like to Assign Task to Team based on Department but to the Role "Department Director".


EDIT: In the process diagram, user task I see the Filter option when you select assign to team and that you can use $result=team.findMembersByRole('Department Director') but when you click over to use Assign to Team based on variable you lose that filter and it becomes a dynamic filter that this doesn't work for any longer unless the syntax has changed maybe?  This (below) did not work:

0 0
replied on July 30, 2018 Show version history

You're halfway there. As I mentioned in the novel I just wrote in reply, this part wasn't really explained anywhere. In order to use the filters on the "Team based on variable" you have to first select "Team". Then select the team that the filter will be applied to. In the Filter Drop down select "Create New Filter". Name the filter and copy the name to your clipboard. Use the $result=team.findMembersByRole('Department Director'); inside the definition (You can test it to make sure that it will return results) and save it. Now that it's saved you can switch back over to "Team based on variable" and you would then paste the filter name into the Dynamic Filter box. This will then allow you the use the filter that you've just created. Note that the filters are specific to the Team itself, so if there are multiple teams that could be resolved from your variable, you'll have to follow to above steps to create the filters for each team. You can reuse the same name on filters that are the same, and if you need to use different filters on the same Team Assignment, that's when you would use a second variable to resolve the Filter Name just the same way you did for the Team Name. 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.