Assign task to Requested For user using the workflow script

gnunez
Kilo Guru

Hi all,

I would like to assign the catalog task to the Requested For user. In my workflow activity for task I added the script task.assigned_to = current.variables.requested_for; but it still assigns the task to the opened by user instead of requested for.

Does anyone know if it has anything to do with the display values for the task table?

Thanks,

Grace

1 ACCEPTED SOLUTION

No. Requested For is a field on Request. So we were trying to access it using current.request.requested_for. 

If it is a variable, we can access it as current.variables.requested_for from RITM or in workflow.

 

The business rule you created, can you change the order of the business rule to 2000 and try again?


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

17 REPLIES 17

SanjivMeher
Kilo Patron
Kilo Patron

You need to use task.assigned_to = current.request.requested_for; 


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,

Thanks for the reply, I've also tried that line but the task will assign to the previous fulfiller rather than the requested for user.

Do you think this might have to do with the table? 

Thanks,

Grace

Not sure. Do you have a requested_for variable on the catalog form, which you can use.

Because if there is one, task.assigned_to = current.variables.requested_for; should work.

 

If there is no requested for field, the user who submitted the request becomes the requestor and the requestor name stored in the request. In this case you can use

task.assigned_to = current.request.requested_for; 


Please mark this response as correct or helpful if it assisted you with your question.

Yes I have a requested for variable on my catalog item. I remember when I tried to assign to assigned to users in the community recommended for to create a BR, which I did and it worked. I tried to do the same with requested for but its not working.