Change change assignment group mid-workflow

Community Alums
Not applicable

Hello all

I have a (very complicated) existing workflow that routes tasks to Assignment Group A.

Now another group in a different physical location, Assignment Group B, will be taking on some of the tasks.   I have already created notifications tailored to the physical location of Group B - if the user clicks "Yes" in answer to a location question, it fires off a notification with Group B's address instead of Group A's -   and that works beautifully & tests perfectly.  

The IF condition determines which email is sent, but Screen Shot 2017-07-13 at 3.09.41 PM.png

i can't work out how to get their tasks to be assigned to them mid-workflow. I have tested another IF condition & just making it a task, but that doesn't allow the notification to be fired and therefore doesn't continue along the required workflow.

I'm thinking there's probably a scripting solution, but I am sadly deficient in scripting. Any tips or ideas?

4 REPLIES 4

randrews
Tera Guru

ok just to clarify are talking about one task you want assigned to a group based on a variable on the item or multiple tasks?


ccajohnson
Kilo Sage

You could use tasks and hopefully you have notifications on the sc_task table for assignments. You should be able to use the advanced portion of the Create Task Workflow Activity to check to see if the (I am guessing) variable is set to yes, then make the assignment accordingly. Here is a sudo example. Be sure to change the variable name and assignment groups accordingly:


createTask(current);



function createTask(itmObj) {


      var grpA = 'PUTTHESYSIDOFGROUPAHERE';


      var grpB = 'PUTTHESYSIDOFGROUPBHERE';


      var chk = itmObj.variables.uses_b == 'yes';


      if (chk) {


              task.assignment_group = grpB;


      } else {


              task.assignment_group = grpA;


      }


}



If any of this is different, please elaborate so we can focus our solution accordingly.


Community Alums
Not applicable

Just one.


They answer yes or no to a location question


That determines their notification email, and the assignment group it should go to.


ok and are you wanting to assign a change to them?? if so just a simple script box.. .. if(variable == 'yourValue'){current.assignment_group == 'assignment group sid';


}



you can also acomplish this with a switch on that question.. with both options going to a set value... one for each of the options...