Tag Control issues on service dialog imports between appliances


#1

Hello,

We have multiple people on our team working on CF 3.2/MIQ (with their own dev envs) and we have a problem with exporting and importing service dialogs and I was wondering what others do to work around it.

If we use Tag Control items, the associations between the dialog element and the tag category gets lost for tags if we export and import between appliances. It appears that this is because the export format uses the specific category_id from the database which only applies to a single environment.

We are working in small iterations so it is common to need to reimport the dialogs into dev environments and production. Needing to go into the dialog and re-associate the tag control items is a source of frustration in dev and deployment consistency issues in prod.

What are other people out there doing to work around this issue?


#2

Hi @ewannema,

You are correct that the tag control is using the category ID as part of the export which would lead to the issue you described. Can you open an issue on github please?

Here is an example from one of my exports:

options:
  :category_id: '60'
  :force_single_value: true
  :sort_by: :description
  :sort_order: :ascending

As a possible work-around maybe you can add the category name in the description of the dialog field and then use a script in your dev environment to adjust the tag fields as needed.

cc @eclarizio


#3

Thanks Greg. I have opened https://github.com/ManageIQ/manageiq/issues/7449

For now I have created a generic dynamic dropdown method that lists the tags for the category specified in its schema. My current dialogs are not multi-select so this workaround is fine for the time being.

If I need multi-select before the issue is closed I will look at your approach.

  category = $evm.object['category']

  dialog_values = {}
  tags = $evm.vmdb('Classification').all.select do |c|
    c.category == category
  end

  if tags.count > 0
    tags.each { |t| dialog_values[t.name] = t.description }
  else
    dialog_values = {'' => 'No tags found.'}
  end