Assigning catalog task to user in "opened_by" field

gnunez
Kilo Guru

Hello all,

I am trying to assign a couple of catalog tasks to the the user in the Opened_by field. I've looked at other posts and I see many suggest to use task.assigned_to = current.opened_by and I added that script to the task.

My problem is that instead of the task assigning to "Opened_by", it assigns to the user who fulfilled the previous task. I also tried changing the display value for Request table from Number to Opened by, but that didn't make a difference.

Has anyone had the same problem or know how to fix this?

Thanks in advance!

1 ACCEPTED SOLUTION

Hi Grace,



This might me happening because the activity which is creating the task is getting invoked by the action to user who is completing previous activity(Previous task in your case). That is why assigned to is being set to the user who is closing previous task.



To Avoid this you can write   following line in your script and run it before insert.



current.assigned_to = current.request_item.opened_by;



Please Like, mark helpful depending on the impact of response.



View solution in original post

24 REPLIES 24

why advanced script is read-only ? also are you sure Task A opened_by and Task A fulfiller are two different people?


Its read-only because my workflow is published. Yes I'm sure because Task A is assigning is assigning properly. The one I'm trying to assign to Opened By is actually the third task (the first 2 are assigning to the proper groups without a problem).



Unpublished view of script:


find_real_file.png


task.assigned_to = current.opened_by


task.opened_by = current.opened_by



add this two lines in WF and test the tasks creation from scratch. it will work.


This was very helpful thank you for all your help! I added the extra line in addition to script posted below this post


Hi Grace,



This might me happening because the activity which is creating the task is getting invoked by the action to user who is completing previous activity(Previous task in your case). That is why assigned to is being set to the user who is closing previous task.



To Avoid this you can write   following line in your script and run it before insert.



current.assigned_to = current.request_item.opened_by;



Please Like, mark helpful depending on the impact of response.