- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2020 12:26 AM
Hello everybody,
I d like to know how to push the requested for variable on the sc_req_item.requested for field
my requested for variable is in set variable I don't know if it can be trouble.
I already searched in the community and it's not working
https://community.servicenow.com/community?id=community_question&sys_id=00c00b65db98dbc01dcaf3231f9619b6&view_source=searchResult
I created a BR on before based on my catalog element and it's working for the other field (self service,telephone and description)
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.requested_for=current.variables.requested;
current.contact_type='self-service';
current.u_t_l_phone_pro=current.variables.telephone;current;
current.description=current.variables.description;
})(current, previous);
Thanks a lot for your help
Have a good day
Barbara CS
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2020 10:43 PM
you can achieve this from workflow.
In the workflow, use Run script and try below code
var req = new GlideRecord("sc_request");
req.addQuery("sys_id", current.request);
req.query();
if(req.next()) {
req.requested_for = current.variables.<variable name>;
req.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2020 10:41 PM
Thanks a lot for your help. I created a workflow with an Run script and it's works! Have a good day