Get User(User ID) doesn't add any value?

Answered Question
Feb 17th, 2017
User Badges:

I was debugging a script where I used a statement like this (where "cucm_user" is a user variable):

cucm_user = Get User("myUserName")

After running the commands above I see (in my debug) that cucm_user is set to "USER[myUserName]" by the Get User step.  Next I tried changing my code by removing the Get User step and just declaring the cucm_user variable like this:

type: User
Name: cucm_user
Value:  USER[myUserName]

I found that skipping the Get User step and just directly declaring my user variable like this works fine (at least for the "Authenticate User Password" and "Upload Prompt" steps).  Is there anything wrong with this approach?  I understand why you'd need to use the Get User step if you were using a pin, but if you're using a username for authentication does the Get User step add any value?

Correct Answer by Jonathan Schulenberg about 2 months 1 week ago

Yes, you can do this. The Expression Language Reference Guide says as much on page 3-126.

You can replace the Get User and the Get User Info steps with one step by using a USER[userID] variable. Then, when a user is requested in the Get User Info step, instead of selecting a “generic” variable of type user, you can directly enter the specific user variable that holds the USER[userID] you want.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Jonathan Schulenberg Sat, 02/18/2017 - 15:28
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 IP Telephony

Yes, you can do this. The Expression Language Reference Guide says as much on page 3-126.

You can replace the Get User and the Get User Info steps with one step by using a USER[userID] variable. Then, when a user is requested in the Get User Info step, instead of selecting a “generic” variable of type user, you can directly enter the specific user variable that holds the USER[userID] you want.

Actions

This Discussion