Automate method


#1

hello,

I need to create a method that reads an Active Directory account attributes.
e.g departmentNumber attribute

I have created the method bellow but it doesn’t return any value.

service = $evm.root[“service_template_provision_task”]
dialog_field = $evm.object
dialog_field[“value”] = $evm.root[‘user’].get_ldap_attribute(‘departmentNumber’)

Pls. can you advise me the right way?

Thanks,
Karel


#2

Which context are you trying to use this method in?


#3

I would like to use it as an endpoint for dynamic value of a texbox in service dialog.


#4

A quick look here tells me you are going the right way. The question is if anything else is interfering. You can do this when you are to execute the dialog:

vmdb
tail -fn0 log/automation.log | egrep 'ERROR|NameOfYourMethod'

To see if it does ERROR out or how and when it gets called. Maybe some $evm.log(:info, 'foo') debugging helps?


#5

The problem was that I copied an attribute name from Ldap AD browser where it is written with capital letter. e.g departmentNumber. If I convert it to lower case then it works well.

service = $evm.root[“service_template_provision_task”]
dialog_field = $evm.object
dialog_field[“value”] = $evm.root[‘user’].get_ldap_attribute(‘departmentnumber’)


#6

That is great then :slight_smile: