BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Programmatic assignment of task

    Posted 2 days ago

    Greetings,

    I have a BAW Case Solution with more than 10 roles. At certain point, I want to assign the current task to another role. So I am using below API in the service flow

    var role = tw.system.org.findTeamByName("targerRole");
    tw.system.currentTask.reassignTo(role.associatedRole);
    From Process Admin, I can see the task is now assigned to the "targetRole" but if try to assign it to the user using "Assign to user" then I don't see any user in the available list although user is added to the role/team. Also, user cannot see the task from user interface.
    If I do the assignment through the swimlanes option then it works fine but due to many roles it might make the process diagram a bit messy.
    Please suggest what is the correct and recommended way to do this ?
    Thanks


    ------------------------------
    Lakshya Agarwal
    ------------------------------


  • 2.  RE: Programmatic assignment of task

    Posted 13 hours ago

    Hi Lakshya,

    I played with your scenario, and I found that code like this worked for me:
    var role = tw.system.org.findTeamByName("TargetRole");
    tw.system.currentTask.reassignTo(role);

    Note that my code is only slightly different than yours.  I will add that I also didn't think it was working at first, but there was a delay until the tasks showed up on the other user's task list.

    Thanks,

    Grant.



    ------------------------------
    Grant Taylor
    ------------------------------