Assign Task based on user full name given from REST service

Comments

2 comments

  • Avatar
    Karl Makatenas

    Two things I can think of.

    First, make sure the activity you're using is capable of placing a single, individual user in the Details area.  In your screenshot, above the list of groups on the right side, is a dropdown.  If there are only two options, Groups and Roles, then you cannot assign an individual user in this activity.  Either use a different activity that can assign Users, or as an alternative, temporarily create a group, make the user the sole member, and assign the group to this activity.  I've had to do this a few times, so if you need more pointers, let me know.  Just remember to delete the group when the activity is complete.

    Second, there is an AgilePoint NX activity named Get User Information that I haven't tested but may help in your situation.  If that doesn't work, you may be able to modify the REST request to pull back other user details instead of just the name, but I haven't looked at the REST API in over a year so I don't know of any methods off-hand.

  • Avatar
    Hong Nguyen

    Thanks Karl for the response!

    After reaching out to our personal consultant, I discovered the REST Get User Information requires the username as parameter which I don't have during run-time.  I only have the user's full name, which doesn't work with the REST webservice.  

    But the consultant told me to use "QueryRegisterUsersUsingSQL" method in the REST service.  This is where you can retrieve detailed information on all the users in the system and provide a SQL WHERE clause to filter what you need. 

    After a few hours, I was unable to get the REST method to work in the eForms using Lookup List configuration.  So I decided to write C# code to access the webservice and execute it there. Then I discovered the syntax for the query looks like this:

    select WF_REG_USERS.USER_NAME_UPCASE, WF_REG_USERS.USER_NAME, WF_REG_USERS.EMAIL_ADDRESS, WF_REG_USERS.REGISTERED_DATE, WF_REG_USERS.FULL_NAME, WF_REG_USERS.MANAGER, WF_REG_USERS.DEPARTMENT, WF_REG_USERS.TITLE, WF_REG_USERS.LOCALE, WF_REG_USERS.TIMEZONE, WF_REG_USERS.ONLINE_CONTACT, WF_REG_USERS.REF_ID, WF_REG_USERS.UAL_EXPIRATION_DATE, WF_REG_USERS.UAL_NEVER_EXPIRES, WF_REG_USERS.USER_ORG_INFO, WF_REG_USERS.LEVEL_, WF_REG_USERS.ALIAS, WF_REG_USERS.DISABLED from WF_REG_USERS Where FullName == '"John, Doe"'

    So I discovered my request body for the REST service was incorrect with the wrong syntax.  The correct body syntax is this (in JSON format):

    {

         "sqlWhereClause": "FULL_NAME = 'John, Doe' "

    }

    Once I got the correct request JSON value, I am now able to pull the user information based on their full name.

    Hopefully this will help others.

    Thanks!

     

     

     

Please sign in to leave a comment.