Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Software assignment with version not always working

    Scheduled Pinned Locked Moved Development
    5 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F Offline
      fa__
      last edited by

      I have detected that I am not able to set the version of some applications when assigning them to a device. It does not happen with all of them and I have not been able to reproduce the issue in the demo. Is there any configuration parameter related to this behavior?

      Here, I include an example of how I retrieve the application versions and assign one of them to a device. Then, when I retrieve the software assignment of the device the version is empty. It appears in the same way in the web interface. It is treated as if the assigned_version did not exist.

      • Read versions of application
      {
          "version": "2.0",
         "method": "cmdb.category.read",
          "params": {
              "objID": 1866,
              "category": "C__CATG__VERSION",
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": [
              {
                  "id": "20",
                  "objID": "1866",
                  "title": "1.0.0",
                  "servicepack": "",
                  "kernel": "",
                  "patchlevel": "",
                  "description": ""
              }
          ]
      }
      
      • Assign application with version to device
      {
          "version": "2.0",
         "method": "cmdb.category.save",
          "params": {
              "object": 1829,
              "category": "C__CATG__APPLICATION",
              "data": {
                  "application": 1866,
                  "assigned_version":"1.0.0"
              },
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": {
              "success": true,
              "message": "Category entry successfully saved",
              "entry": 194
          }
      }
      
      • Check software assigned to device
      {
          "version": "2.0",
         "method": "cmdb.category.read",
          "params": {
              "objID": 1829,
              "category": "C__CATG__APPLICATION",
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": [
              {
                  "id": "194",
                  "objID": "1829",
                  "application": {
                      "title": "App2",
                      "id": "1866",
                      "connection_id": "322",
                      "type": "C__OBJTYPE__APPLICATION",
                      "type_title": "Application",
                      "sysid": "SYSID_1623405979"
                  },
                  "application_type": {
                      "id": "1",
                      "title": "Software",
                      "const": "C__CATG__APPLICATION_TYPE__SOFTWARE",
                      "title_lang": "LC__CATG__APPLICATION_TYPE__SOFTWARE"
                  },
                  "application_priority": null,
                  "assigned_license": false,
                  "assigned_license_key": null,
                  "assigned_database_schema": false,
                  "assigned_it_service": false,
                  "assigned_variant": null,
                  "assigned_version": null,
                  "bequest_nagios_services": {
                      "value": "0",
                      "title": "No"
                  },
                  "assigned_databases": null,
                  "description": ""
              }
          ]
      }
      
      LFischerL 1 Reply Last reply Reply Quote 0
      • LFischerL Offline
        LFischer @fa__
        last edited by

        Hey @fa__

        can you also reproduce this issue with "names" versions like for example "version 1.0.0"? I think it might be possible that i-doit mistakes the given version for a numeric value and tries to assign something that's not there.

        I'll also try to reproduce your issue later 🙂

        Best regards
        Leo

        1 Reply Last reply Reply Quote 0
        • LFischerL Offline
          LFischer
          last edited by

          Hello again,

          I can reproduce this issue, but only if another application object already has a version with the same name. So, imagine you have to application objects:

          • Firefox (which has no versions)
          • Chrome (which has versions "90.0" and "91.0")

          Now you'll try to update you "Firefox" installation and set the version "90.0"... This should result in the same error.

          i-doit tries to update the Firefox installation but with the found version "90.0" (but from the Chrome application). Because this version does already belong to a different application object it does not work out.

          I'll figure out where it goes wrong 🙂

          F 1 Reply Last reply Reply Quote 0
          • F Offline
            fa__ @LFischer
            last edited by fa__

            Hello @lfischer,

            You're right. It fails when there exists another software with a version with the same name.
            It only works for the first application where a version name is defined.

            I can also confirm that issue is not only for numeric values, names as the one you suggest also fail.

            As an alternative, what does work is to include the version id in the query, instead of the version title. In the case described in my first post, the following query works fine:

            {
                "version": "2.0",
               "method": "cmdb.category.save",
                "params": {
                    "object": 1829,
                    "category": "C__CATG__APPLICATION",
                    "data": {
                        "application": 1866,
                        "assigned_version":20
                    },
                    "apikey": XXXX,
                    "language": "en"
                },
                "id": 1
            }
            
            LFischerL 1 Reply Last reply Reply Quote 0
            • LFischerL Offline
              LFischer @fa__
              last edited by

              Hey @fa__

              yes, that's correct - working with the ID will work, since i-doit does not have to "look up" the correct version on its own. I have created a bug ticket for the this 🙂 Thanks for finding this issue!

              Best regards
              Leo

              1 Reply Last reply Reply Quote 0
              • First post
                Last post