- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:52 PM
Hi,
Currently I'm making a service request where I am making an approval - group activity (in the workflow) and trying to use a form field value's assignment group.
I've been attempting the following script to no success. Please see below:
var answer = [];
answer.push(current.variables.ci_name.assignment_group);
Note: ci_name is the form field value name (and pulling its value from the cmdb_ci table), and the assignment_group value is the field name on a Configuration Item form.
Any help is appreciated. Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 10:35 AM
Upon review of another team member's perspective, the coding I had opened the thread for is working now as expected.
Honestly I'm not 100% sure why the correct code was failing. I appreciate the alternatives listed. Those should be used if needed.
Thank you all,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 04:41 PM
change_control should be the column name in the cmdb_ci table.
My variable "ci_name" is picking a value from the "cmdb_ci_server" table, but even in that table the Approval group should have a column name of "change_control".
Is my error message related to not pointing to the correct field on the ci or elsewhere?
Thank you for everyone's help so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 11:56 PM
Could you try change the variable to reference to cmdb_ci and then try to pick the same record and see if that works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:57 PM
Is it erroing when the flow is run?
And have you tried to log out current.variables.ci_name.assignment_group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 10:35 AM
Upon review of another team member's perspective, the coding I had opened the thread for is working now as expected.
Honestly I'm not 100% sure why the correct code was failing. I appreciate the alternatives listed. Those should be used if needed.
Thank you all,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 11:41 AM
Glad you found a solution.
If you don't mind, please mark replies from others as Helpful, if they were.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
