https://github.com/romain-dartigues/mantisbt-customfieldslinks
provide custom links for custom fields in MantisBT
https://github.com/romain-dartigues/mantisbt-customfieldslinks
mantisbt-plugin
Last synced: 11 months ago
JSON representation
provide custom links for custom fields in MantisBT
- Host: GitHub
- URL: https://github.com/romain-dartigues/mantisbt-customfieldslinks
- Owner: romain-dartigues
- License: bsd-3-clause
- Created: 2018-08-17T08:12:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T12:30:11.000Z (almost 8 years ago)
- Last Synced: 2025-04-04T19:16:07.782Z (about 1 year ago)
- Topics: mantisbt-plugin
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
[](https://www.codacy.com/app/romain-dartigues/mantisbt-customfieldslinks?utm_source=github.com&utm_medium=referral&utm_content=romain-dartigues/mantisbt-customfieldslinks&utm_campaign=Badge_Grade)
This [MantisBT] [plug-in](https://github.com/mantisbt-plugins/) is an attempt to provide custom links for custom fields.
[MantisBT]: https://github.com/mantisbt/mantisbt
## Use case
Say you want to be able to link an issue in your Mantis to another Mantis and another tool (Atlassian Jira®, GitHub®, … whatever).
1. you [create][ccf] two new [custom fields], for example: `Jira_project`, `GitHub_project_issue` and `OtherMantis_project`
2. set them as "string type", with a regular expression to use for validating user input (examples: `(\w+)` or `(\d+)`); this part is important because the regex will be used for data extraction by the plug-in
3. configure this plug-in through the administration interface, for example:
```
Jira_project = https://jira.example.net/browse/%s
GitHub_project_issue = https://github.com/project-group/project/issues/%d
OtherMantis_project = https://mantisbt.example.net/view.php?id=%d
```
That's it, now your custom fields will be links.
[custom fields]: https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html/admin.customize.customfields.definitions.html
[ccf]: https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html/admin.customize.customfields.editing.html
## Notes
I quickly made this plug-in to answer some internal needs, to replace the legacy solution which was an ugly patch against `core/custom_field_api.php` `string_custom_field_value()`, and lastly because I haven't found a more appropriate way to do it.
I wouldn't had needed to go to such hackish lengths if MantisBT bug / feature-request [#13180] (Url template custom field) would have been properly implemented to the core.
[#13180]: https://www.mantisbt.org/bugs/view.php?id=13180
If you know a more sensible way to implement this, by any means, [let me know](https://github.com/romain-dartigues/mantisbt-customfieldslinks/issues/new).