How can I pass values from RITM to Task in workflow

kevinwhittaker
Tera Contributor

I have an RITM form that I need to pass values on to the tasks that are created with in a workflow.   I need to pass the Business Unit field from the RITM to the Business Unit field on the created Task.   I've tried numerous different ways and none have worked...any help is appreciated.

I also have the same values on the Request (Business Unit) that I could use to pass to the created Task within a workflow.   I'm pretty new to this so I would again appreciate any help or advice.   Thank you!

1 ACCEPTED SOLUTION

Use this in the advanced script and see if it works



task.short_description = "Forward Desk Phone - " + " " + current.variables.u_ucmt_who.getDisplayValue() + " " + "-" + " " + current.variables.u_ucmt_date.getDisplayValue();


if (task.u_business_unit == '') {


  task.u_business_unit = current.u_ucm_bu;


}


if (task.u_location == '') {


  task.u_location = current.u_ucm_loc;


}


task.u_itp_reqfor = current.request.requested_for;


task.u_ucm_due_date = current.due_date;


View solution in original post

27 REPLIES 27

Abhinay Erra
Giga Sage

If your workflow is on requested item, user this in the advance script section of your create task activity in the workflow.



task.<business unit field name on the task>=current.variables.<variable name of business unit>;


OK so here is my workflow properties (notice it is set for the sc_req_item table)Workflow Properties.png



Here is the actual task that is created in the workflow and it is creating the task on the sc_task table


IT Off Catalog Task.png


Notice...I used the code that you suggested but the outcome is still not Business Unit Present on the catalog task.   But the Business Unit is present on the RITM and REQ.   Is my problem because (1st image) is not using the sc_task table?


Mihir Mohanta
Kilo Sage

If Business unit is a field not an catalog variable in RITM form then you can use



task.u_business_unit = current.u_business_unit;



Thanks,


Mihir


Business Unit is a field on the RITM form...I've also tried the code suggested above with no luck still blank no Business Unit populating on the task form.


RITM form.png