If a User Attribute fails to update, it blocks the import from updating the object completely

XMLWordPrintable

    • 1
    • Severity 2 - Major

      Issue Summary

      If a User Attribute fails to update, it blocks the import from updating the object completely.

      Steps to Reproduce

      1. Create an Object Type with Name, a User Type Attribute called Jira User and a Text Attribute called Text.
      2. Create 3 users in your Jira: User X, User Y, User Z
      3. Manually create 3 objects, and select User X, User Y, User Z in the User Type Attribute, leave the Text Attribute blank
      4. Export the objects to CSV (Data consistent)
      5. In Jira users list, delete User Z
      6. In the exported CSV, add any text in the Text Column for all rows (e.g. "This is my Text")
      7. Configure a CSV Import and map Name, Jira User and Text attributes 1:1 into this Object Type
      8. Sync the import

      Expected Results

      The validation errors are logged, and the import skips update for the missing field value. All other attributes on the concerning objects are updated.

      Actual Results

      The import is blocked and it does not finish updating the affected objects.

      The below exception is thrown in the insight_import.log file:

      2021-03-19 15:31:14,370 [insight-InsightImportThreadGroup-worker-thread-1] | Failed to update object: User Z (MOS-50), ObjectTypeId: 34, Attributes: (AttributeTypeId: 226, value(s):[335(JIRAUSER10602)],AttributeTypeId: 223, value(s):[null(User Z)],AttributeTypeId: 227, value(s):[null(this is my text)]), avatar: false with actions: [UPDATE] due to ValidationInsightException: Validation errors were found: rlabs-insight-attribute-226: ErrorMessage{i18nKey='rlabs.insight.i18n.constraint.violation.ObjectAttributeValueBean.NotFound.Users', parameters=[JIRAUSER10602], additionalMessage=null};
      ...
      2021-03-19 15:31:14,379 [insight-InsightThreadGroup-worker-thread-4] | UserImport>>> Finished import with id 4 of type rlabs-import-type-csv at time 2021-03-19T15:31:14.379. Import took 136 ms
      2021-03-19 15:31:14,398 [insight-InsightThreadGroup-worker-thread-4] | com.riadalabs.jira.plugins.insight.services.imports.common.ImportResult@21db4bba[
        status=FINISHED
        started=Fri Mar 19 15:31:14 UTC 2021
        ended=Fri Mar 19 15:31:14 UTC 2021
        executedType=MANUAL
        executedAsUserKey=JIRAUSER10200
        objectSchemaId=2
        numberOfWorkers=2
        importSourceId=4
        populatedObjectTypes=[UserTest, UserTest]
        moduleKey=rlabs-import-type-csv
        moduleVersion=1
        updateReferencesTimeInMs=0
        onlyExecutedForObjectTypeIds=[]
        result=OBJECT_TYPE_ERRORS
        infoMessage=<null>
        errorMessages=[UserTest]
        ObjectTypes : objectTypeResultMap={34=com.riadalabs.jira.plugins.insight.services.imports.common.ImportResult$ObjectTypeResult@138d8b8c[
        objectTypeName=UserTest
        objectTypeId=34
        objectsUpdated=2
        objectsCreated=0
        objectsIdentical=0
        entriesInSource=3
        objectsFilteredWithIQL=0
        duplicateEntries=0
        emptyLabelEntries=0
        emptyExternalIdEntries=0
        objectsMissingUpdated=0
        objectsMissingDeleted=0
        errorMessages=[User Z(MOS-50): User(s) (JIRAUSER10602) not found in Jira]
        readExternalDataTimeInMs=3
        mapExternalDataTimeInMs=0
        iqlFilteringDataTimeInMs=0
        decidingActionsTimeInMs=1
        writeInsightDataTimeInMs=185
        postFunctionTimeInMs=1
        executionTimeInMs=190
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Notes

      The only way to circumvent import validation errors is to remove the value for attribute mapping to "User" attribute, that references the deleted user.

              Assignee:
              Unassigned
              Reporter:
              Marko Filipan (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: