Automate method


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?


1 Like

Which context are you trying to use this method in?

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

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:

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?

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’)

That is great then :slight_smile: