How to assign a task to 3-4 users of different group?

I have a user input task , I want to assign task to 3-4 users dynamically using if else

for example:

local!flag:true

local!myArray: {
{ name: "Aish", category: "A" },
{ name: "Jenny", category: "A" },

},

if local!flag is true, assign task to users in local!myArray ,

else assign task to a single user i.e loggedinuser()

Please help

  Discussion posts and replies are publicly visible

Parents
  • Hi , I'm not sure if you want to dynamically create the same task for 4 different users or if you want to only assign (and expect only one to accept it) to 4 different users of different groups. For the first option, you should consider Stewart's approach. If you're looking for the 2nd option, there is nothing preventing you to have that assignment logic in a expression rule and then use it in the Assignment Tab of your User Input Task. Something as simple as the code below would do the trick. Hope it helps

    a!localVariables(
      local!flag: true,
      local!myArray: {
        { name: "username1", category: "A" },
        { name: "username2", category: "A" },
        
      },
      if(
        local!flag,
        touser(local!myArray.name),
        loggedInUser()
      )
    )

  • Hi Pedro 

    if(
    local!flag,
    touser(local!myArray.name),
    loggedInUser()
    )

    in this case, will it create separate tasks for each user in the array??

Reply Children