Error Message for Invalid Group Name Missing When Creating Asset Objects via API

XMLWordPrintable

    • 3
    • Severity 3 - Minor
    • 1

      Issue Summary

      When creating an Assets object using the API with an attribute of type "Group," if the group name provided in the API data is incorrect or doesn't exist in Jira, it generates the following error without specifying the name of the group that caused the issue:

      {"errorMessages":[],"errors":{"rlabs-insight-attribute-205":"Invalid Group"}}

      In Assets version 8.9.4, when the group didn't exist in Jira, the API's error message provided more information on which group is causing the issue, like this:

      {"errorMessages":[],"errors":{"rlabs-insight-attribute-205":"Invalid Group(s) (fake-group)"}

      This is reproducible on the Data Center: Yes

      Steps to Reproduce

      1. You need to have an object type, which has a “Group” attribute. 
      2. Call the API using "POST /rest/insight/1.0/object/create" to create a new object. Here's an example using curl:
        curl -ks -u $cred -H "Content-Type: application/json" -d @data.json "https://your.jira.domain/rest/insight/1.0/object/create" -w -n
      3. The content of "data.json" should be the following, where you set a group that doesn't exist in Jira. In this example, "fake-group" is used:
        {
            "attributes": [
                {"objectAttributeValues": [{"value": "New Object"}], "objectTypeAttributeId": 197},
                {"objectAttributeValues": [{"value": "fake-group"}], "objectTypeAttributeId": 205}
            ],
            "objectTypeId": 28
        } 

      Expected Results

      In case the group name is incorrect or does not exist, it should print the group name in the error message, like below:

      {"errorMessages":[],"errors":{"rlabs-insight-attribute-205":"Invalid Group(s) (testgroup)"} 

      Actual Results

      With the new version, the error message does not include the group name, as shown below:

      {"errorMessages":[],"errors":{"rlabs-insight-attribute-140":"Invalid Group"}}  

      Workaround

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

              Assignee:
              Yiwen Zhang
              Reporter:
              Rakesh Kumar (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: