
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2019 02:41 PM
I am trying to create a dynamic workflow approval based on a reference variable. For example, I have a point where a manager of a cost center is required for approval when the cost center variable is selected on the catalog item. For more details into what I mean, I will provide a better example.
Catalog Item Request --> Variable Cost Center A Selected from reference field --> Approval - Manager of Cost Center (dynamically based on the cost center that was selected).
If you need more info let me know.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 06:35 AM
HI,
You have to use Approval User activity in workflow. There you have to write below code in Script section. See below
I have mentioned script as well in Script box above.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2019 02:43 PM
If its a reference variable, do something like this
current.variables.cost_center.YourRequiredField.toString();
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 05:18 AM
Can you provide context to where this should go? Based on your example I am trying the following in the scripting area for Approval- User on the workflow:
current.variables.cost_center.cmn_cost_center.code.toString();
I am receiving the following error when I attempt to use this code for the approval user:
"illegal use to getmessage in class org.mozilla.javascript.rhino exception"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 06:35 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2019 07:32 AM
Thank you for the info. I am no longer getting the error.
I am noticing now that it skips this approval now in the workflow. Like there is no approver.