Get latest version number of many appian object via code

I want to get latest version number of 50+ appian objects. Is there a way to write some script to get there version number based on their names. Currently i had to open each objects manually and note its version number.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi, you can use the below code but it will be used for some component only which you have to check. I check it for Expression rules, Constants and for interfaces. It won't run for Process model, DT, DS.

    a!localVariables(
      local!items: getcontentobjectswithnumofversions(1, "all", false()),
      local!itemsToCheck: a!forEach(
        items: local!items,
        expression: {
          Name: keyval(fv!item, "Name", ": ", ",UUID"),
          version: keyval(
            fv!item,
            "Total versions",
            ": ",
            ",Created"
          )
        }
      ),
      index(
        local!itemsToCheck,
        wherecontains(
          "UAC_account",
          a!flatten(local!itemsToCheck.Name)
        ),
        {}
      )
    )

Reply
  • 0
    Certified Senior Developer

    Hi, you can use the below code but it will be used for some component only which you have to check. I check it for Expression rules, Constants and for interfaces. It won't run for Process model, DT, DS.

    a!localVariables(
      local!items: getcontentobjectswithnumofversions(1, "all", false()),
      local!itemsToCheck: a!forEach(
        items: local!items,
        expression: {
          Name: keyval(fv!item, "Name", ": ", ",UUID"),
          version: keyval(
            fv!item,
            "Total versions",
            ": ",
            ",Created"
          )
        }
      ),
      index(
        local!itemsToCheck,
        wherecontains(
          "UAC_account",
          a!flatten(local!itemsToCheck.Name)
        ),
        {}
      )
    )

Children