Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem New custom field in Notification Templates #2826

Closed
lamaratonaug opened this issue Oct 27, 2023 · 9 comments · Fixed by #2840
Closed

Problem New custom field in Notification Templates #2826

lamaratonaug opened this issue Oct 27, 2023 · 9 comments · Fixed by #2840
Assignees
Milestone

Comments

@lamaratonaug
Copy link

I have a problem when I try to add a new "custom field" inside a notification templates"

I correctly created a data field categories and added 2 data fields, but when I go to add it to the template notification it gives me an error which I report in the attachment

Your Environment

  • Director version (1.11.0):
  • Icinga Web 2 version and modules (2.12.0):
  • Icinga 2 version (r2.14.0-1):
  • Operating System and version:
  • Debian 11.8

Image 003

@timblankman
Copy link

timblankman commented Oct 31, 2023

We have also this problem only in a Host Template

@leanderlingens
Copy link

Hello,

I have the same problem for the notification templates and the user templates. It's not possible to select data fields.
image

Server: Debian 12
Software: PHP8.2, nginx, director (1.11.0)

Kind regards
Leander Lingens

@obivatelj-afk
Copy link

obivatelj-afk commented Nov 15, 2023

Same Problem here.

My Environment
Director version 1.11.0
Icinga Web 2 version and modules 2.12.0
Icinga 2 version (r2.14.0-1):
With PHP 8.0.30 and 8.2.12 tested
Operating System and version:
Debian 12.2

@sol1-matt
Copy link

I upgraded an existing installation to Director v1.11.0 recently and found the same problem with new host, service and notification templates, no data fields are selectable at all.
On some existing templates I am able to select new data fields for hosts and services. None of the existing notification templates the data fields can select new data fields.
This installation has 100's of existing datafields and templates that select them.

On a different installation which was a clean install we found the same problem, no data fields are selectable at all on host, service or notification templates.

Both installations were
Director: 1.11.0
incubator: 0.20.0
icinga-php-thirdparty: 0.12.0
icinga-php-library: 0.13.0

The upgraded installation was PHP 8.2.7
The clean installation was PHP 8.1.x

The exact error message is There are no data fields available. Please ask an administrator to create such

The error seems to be coming from IcingaObjectFieldForm.php.

@sol1-matt
Copy link

One workaround to this problem is to create a director basket which creates the fields for you.
I've tested this and it works, it is not a trivial thing to create a basket by hand though.

@willfurnell
Copy link

@sol1-matt Do you have an example of that please? Unfortunately I am in the same situation here trying to add a custom field to a notification template
mail-template-host-director-custom-fields

@sol1-matt
Copy link

sol1-matt commented Nov 26, 2023

@willfurnell
You can find some examples of baskets that I've created here (https://github.com/sol1/sol1-icinga-notifications/tree/main/director_baskets). edit: correct url

I'd suggest exporting out an existing template and if the Datafield's are missing add them in.
Export can have UUID's, I typically remove those and use random id's but that might not be the best approach.

The above repo also had a generator branch which is still experimental and focused on Notification Templates only so far.

The LinuxFab Plugin's also have baskets and a generator if you need another reference.

@RincewindsHat
Copy link
Member

Probably related/duplicate #2815

@bobapple
Copy link
Member

bobapple commented Dec 4, 2023

ref/IP/48629

@bobapple bobapple added the ref/IP label Dec 4, 2023
@raviks789 raviks789 self-assigned this Dec 6, 2023
@nilmerg nilmerg added this to the v1.11.1 milestone Jan 16, 2024
@nilmerg nilmerg added the bug label Jan 16, 2024
nilmerg added a commit that referenced this issue Jan 16, 2024
Other available fields should be suggested when no check command has
been chosen for service template.

fixes #2826, #2815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants