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

Make templates and their corresponding fields configurable in UI #95

Merged
merged 8 commits into from
Mar 9, 2023

Conversation

raviks789
Copy link
Contributor

@raviks789 raviks789 commented Feb 2, 2023

The templates and their corresponding has been configurable in UI.
This PR also include changes to allow passing arrays to Jira Tickets.

ref #88

@cla-bot cla-bot bot added the cla/signed label Feb 2, 2023
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch 8 times, most recently from 491282c to cbe7526 Compare February 8, 2023 08:58
Copy link

@verboEse verboEse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks promising. If I understand this correctly, this not only allows you to include "arrays" like requested in #88, but furthermore allows you to select (?) custom JIRA fields to fill with values from Icinga and make those even configurable from the configuration page in Icinga.
I found that it's not possible to define custom fields that require other key-value pairs from the templates config file. Example:
customfield_10184 = '{ "id": "22806" }'
isn't working.
Will this be possible with your approach? I will create a new issue otherwise.

Update: I just found that this occurs when the custom field type is "option" - which you excluded here, probably because the assignment of "free" values from data fields in Icinga possibly won't match these possible values. Some installations do have such fields configured as required though, so it would be great to include them, too. Maybe it's possible to just add a warning about this problem when configuring the field?

@raviks789 raviks789 force-pushed the feature/add-field-configuration branch 2 times, most recently from cabf056 to 859ccca Compare February 13, 2023 09:05
@raviks789 raviks789 changed the title WIP Make templates and its corresponding fields configurable in UI Feb 13, 2023
@raviks789 raviks789 changed the title Make templates and its corresponding fields configurable in UI Make templates and their corresponding fields configurable in UI Feb 13, 2023
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch from 859ccca to bf2c2d9 Compare February 13, 2023 09:44
@raviks789
Copy link
Contributor Author

raviks789 commented Feb 13, 2023

Hi @verboEse,
Do you mean, you want to get the value for one custom field for example customfield_10184 from another custom field customfield_ 22806?

@verboEse
Copy link

I'm not sure how this is accomplished, but in WebUI I get a drop-down when trying to change the field and only the offered values are allowed for the custom field.

@raviks789 raviks789 force-pushed the feature/add-field-configuration branch 2 times, most recently from 60d5d24 to 243cc38 Compare February 15, 2023 15:26
library/Jira/Web/Table/Templates.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/Templates.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/JiraCustomFields.php Outdated Show resolved Hide resolved
application/controllers/FieldsController.php Outdated Show resolved Hide resolved
application/controllers/FieldsController.php Outdated Show resolved Hide resolved
library/Jira/MonitoringInfo.php Show resolved Hide resolved
library/Jira/Web/Form/NewIssueForm.php Show resolved Hide resolved
library/Jira/Web/Table/JiraCustomFields.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/JiraCustomFields.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/Templates.php Outdated Show resolved Hide resolved
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch from 4be19fd to 9a24d12 Compare March 6, 2023 15:13
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch from 9a24d12 to 323e92f Compare March 6, 2023 16:16
@raviks789 raviks789 requested a review from nilmerg March 7, 2023 08:14
application/controllers/TemplatesController.php Outdated Show resolved Hide resolved
application/controllers/TemplateController.php Outdated Show resolved Hide resolved
application/controllers/TemplateController.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/TemplateTable.php Outdated Show resolved Hide resolved
library/Jira/Web/Table/JiraCustomFields.php Outdated Show resolved Hide resolved
application/forms/Config/FieldConfigForm.php Outdated Show resolved Hide resolved
application/forms/Config/FieldConfigForm.php Outdated Show resolved Hide resolved
@nilmerg nilmerg linked an issue Mar 7, 2023 that may be closed by this pull request
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch 2 times, most recently from cc81149 to 66631e2 Compare March 7, 2023 14:21
@raviks789 raviks789 requested a review from nilmerg March 7, 2023 14:23
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch 6 times, most recently from ce8beca to a99c320 Compare March 8, 2023 08:11
@raviks789
Copy link
Contributor Author

raviks789 commented Mar 8, 2023

This looks promising. If I understand this correctly, this not only allows you to include "arrays" like requested in #88, but furthermore allows you to select (?) custom JIRA fields to fill with values from Icinga and make those even configurable from the configuration page in Icinga. I found that it's not possible to define custom fields that require other key-value pairs from the templates config file. Example: customfield_10184 = '{ "id": "22806" }' isn't working. Will this be possible with your approach? I will create a new issue otherwise.

Update: I just found that this occurs when the custom field type is "option" - which you excluded here, probably because the assignment of "free" values from data fields in Icinga possibly won't match these possible values. Some installations do have such fields configured as required though, so it would be great to include them, too. Maybe it's possible to just add a warning about this problem when configuring the field?

@verboEse, currently only string, number or array (only labels) type custom fields are supported for configuration in the Web GUI.
In your case, which might be single-select custom field. You could directly configure it in templates.ini file like below.

[template_name]
customfield_10184.id =  "22806"
customfield_10185.value =  "option_value"

Or in case of multi-select custom field:

[template_name]
customfield_10184.0.id =  "22806"
customfield_10184.1.id =  "22807"
customfield_10185.0.value =  "option1_value"
customfield_10185.1.value =  "option2_value"

Update: You could either use customfield_10184.id or customfield_10184.value. Same in the case of multi-select.

@raviks789 raviks789 force-pushed the feature/add-field-configuration branch from a99c320 to 1e531b1 Compare March 8, 2023 14:02
You can configure a template to be used while creating the issues in this tab.
Also, list all the configured templates.
The fields to be added to the specific configured template will be added here.
Also, make changes to IssueTemplate class to allow arrays to be sent to the jira fields.
…rm` as base form for NewIssueForm

Since Icinga\Module\Jira\Web\Form, library/Jira/Web/Form/LegacyDecorator, form-compat26 css class and changes
to form-element-description css class are removed.
@raviks789 raviks789 force-pushed the feature/add-field-configuration branch from 1e531b1 to cfe63d5 Compare March 9, 2023 15:29
@raviks789 raviks789 merged commit 0c6cdb5 into master Mar 9, 2023
@raviks789 raviks789 deleted the feature/add-field-configuration branch March 9, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing arrays to Jira tickets
4 participants