Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-842

ServiceNow: Generated schema has two editable properties are mapped to one attribute

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: servicenow-connector-1.5.0.0
    • Component/s: ServiceNow Connector
    • Labels:
    • Environment:
      Linux Mint 18.2 Cinnamon 64-bit,
      openjdk version "1.8.0_151",
      OpenIDM version "6.0.0-SNAPSHOT" (revision: 674d0a6),
      ServiceNow Connector 1.5.0.0-SNAPSHOT (SCM-Revision: 43c3b928790359cc0a5f618d2240ed3e8cb47cf2)

      Description

      All ObjectTypes in provisioner file for ServiceNow have two editable properties mapped to one servicenow attribute. For example objectType "user" has editable "email" and "__NAME__" properties which are mapped to "email" serviceNow attribute of "user" table.

      "email" : {
                          "type" : "string",
                          "nativeName" : "email",
                          "nativeType" : "string",
                      },
      "__NAME__" : {
                          "type" : "string",
                          "required" : true,
                          "nativeName" : "__NAME__",
                          "nativeType" : "string"
                      },
      

      However during create user via REST, serviceNow "email" has always value of "email" property.

      curl -X POST \
        'http://localhost:8080/openidm/system/serviceNow/user?_action=create' \
        -H 'content-type: application/json' \
        -H 'x-openidm-password: openidm-admin' \
        -H 'x-openidm-username: openidm-admin' \
        -d '{
              "first_name": "FIRSTNAME",
              "last_name": "LASTNAME",
              "email": "email@example.com",
              "__NAME__": "Some__NAME__",
              "phone": "555-123-1234"
             }'

       

      Steps to reproduce in "user" table:

      1. Download OpenIDM and ServiceNow connector
      2. Unzip OpenIDM and prepare OpenIDM for add ServiceNow connector according documentation
      3. Start OpenIDM
      4. Log in as openidm-admin at browser on URL http://localhost:8080/admin
      5. Add Connector - Navigate to Configure > Connector and click on New Connector
      6. Select Connector type to ServiceNow Connector and fill all required fields
      7. Click on Save button
      8. Add user with "email" property
        curl -X POST \
          'http://localhost:8080/openidm/system/serviceNow/user?_action=create' \
          -H 'content-type: application/json' \
          -H 'x-openidm-password: openidm-admin' \
          -H 'x-openidm-username: openidm-admin' \
          -d '{
        "first_name": "FIRSTNAME",
        "last_name": "LASTNAME",
        "email": "email@example.com",
        "__NAME__": "Some__NAME__",
        "phone": "555-123-1234"
        }'
      9. Add user without "email" property
        curl -X POST \
          'http://localhost:8080/openidm/system/serviceNow/user?_action=create' \
          -H 'content-type: application/json' \
          -H 'x-openidm-password: openidm-admin' \
          -H 'x-openidm-username: openidm-admin' \
          -d '{
        "first_name": "FIRSTNAME2",
        "last_name": "LASTNAME2",
        "__NAME__": "Some__NAME__",
        "phone": "555-123-1234"
        }'

      Actual result:

      • User with "email" property - The user was created and response had displayed value of "email" to "__NAME__".
        {
            "_id": "testID1234567890",
            "sys_domain": "global",
            "sys_id": "testID1234567890",
            "email": "email@example.com",
            "web_service_access_only": false,
            "sys_created_on": "2018-03-15",
            "vip": "false",
            "sys_class_name": "sys_user",
            "sys_updated_by": "admin",
            "last_name": "LASTNAME",
            "__NAME__": "email@example.com",
            "sys_updated_on": "2018-03-15",
            "password_needs_reset": "false",
            "calendar_integration": "1",
            "sys_created_by": "admin",
            "first_name": "FIRSTNAME",
            "notification": "2",
            "locked_out": "false",
            "phone": "555-123-1234",
            "sys_domain_path": "/",
            "sys_mod_count": "0",
            "internal_integration_user": false,
            "active": "true"
        }
      • User without "email" property - The user was created and response had displayed "" to "__NAME__", not "Some__NAME__2".
        {
            "_id": "testID1234567891",
            "sys_domain": "global",
            "sys_id": "testID1234567891",
            "web_service_access_only": false,
            "sys_created_on": "2018-03-15",
            "vip": "false",
            "sys_class_name": "sys_user",
            "sys_updated_by": "admin",
            "last_name": "LASTNAME2",
            "__NAME__": "",
            "sys_updated_on": "2018-03-15",
            "password_needs_reset": "false",
            "calendar_integration": "1",
            "sys_created_by": "admin",
            "first_name": "FIRSTNAME2",
            "notification": "2",
            "locked_out": "false",
            "phone": "555-123-1234",
            "sys_domain_path": "/",
            "sys_mod_count": "0",
            "internal_integration_user": false,
            "active": "true"
        }

      Expected result:
      I would expect that __NAME__ should be mapped to required attribute. Should not exists mapping two or more editable properties to one attribute. One property should be editable and other properties should be only for read.

      Possible solution - change mapping to some required attribute at ServiceNow. Maybe It is only sys_id > then set __NAME__ as read only. Because all attributes in default serviceNow instance are non-required and sys_id is generated (only for read).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petr.jurica Petr Jurica [X] (Inactive)
                Reporter:
                miroslav.meca Miroslav Meca
                QA Assignee:
                Miroslav Meca
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: