Requested for defaulting to Opened By

allison_holt
Giga Expert

Whenever I create Service Catalog items, they are defaulting to the Opened by person unless I include a script that sets the requested for person. The script works great and I am able to get the requested for person to match the requested for variable, but we are wanting to be able to use the cloning function for catalog items. Whenever I use the cloning function with this script in place, the first task is correct, but the clones are the same requested for person as the initial task. If I don't have the script in place, the first task has the opened by person, but the clones have the correct people.

I have tried using a business rule that i found on this community page Requsted for field is defaulting for Service Requests?, but it still does the same as my script within my workflow.

Hopefully that made sense.

Any help would be greatly appreciated!!

Allison

1 ACCEPTED SOLUTION

Sure.   I created the following business rule:


table:   sc_req_item


when: before


Insert: true


condition:   current.variables.requested_for != undefined



if (gs.getSession().isInteractive()){  


var user = current.variables.requested_for.getDisplayValue();


current.request.requested_for.setDisplayValue(user);  


}



Hope this helps!


A


View solution in original post

15 REPLIES 15

TJW2
Mega Guru

The sc_cart table is where the Requested For is stored. It has a default value of javascript:gs.getUserID(). If you are getting the 'Requested For' in a variable on the cat item, the variable value will NOT change when you use the clone functionality.


If I change the default value on the sc_cart table, will the clone feature not work? Or is there a way to get this functionality to work with the variable and the clone?


allison_holt
Giga Expert

If I change the default value on the sc_cart table, will the clone feature not work? Or is there a way to get this functionality to work with the variable and the clone?


TJW2
Mega Guru

The Service Catalog variables are NOT held on the sc_req_item table, they have their own table with a tie to the ritm. A CLONE is an 'exact' copy of the RITM (variables and all) with the Requested For on the Cart Changed.
Another approach may be to write an on Insert BR that synchs the variable to the REQ Requested For?