I wonder if I could develop a JIRA custom field plugin (of Version type), which will be able to sort the Version list when it is displayed for view or editing. Also, can I put in additional logic to the field edit to control / validate its content before it can be saved to the JIRA issue. Thanks.
Yes, you can do all that in a custom-field plugin. Check out https://developer.atlassian.com/server/jira/platform/custom-field/
Hi Jobin,
Thank you for your reply. I am reading thru your book on this topic and have few questions:
1. My custom plugin needs to extend the version field type. In the velocity file, what HTML type do I use to display this Version type input box?
2. Continuing from #1, how do I sort the versions and display them in that input field?
3. How do I perform input validation on this version so that he data can be saved only when the conditions are met?
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know where to start because there can be a lot of different things to you can do, mainly because it has nothing to do with JIRA plugins. It is all about the UI experience :)
Keeping that in mind, you might want to look for some Ajax plugins that will retrieve all versions and show it in a user friendly way and allow sorting.
For #3, it depends on the conditions. You can do the validation on the UI itself or you can do some validation in the custom field type class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, in the customfield, I want to show only the versions that have not been selected in other JIRA issues, and I want to sort the versions when the selected ones are displayed in the customfield. I need to be able to enforce this validation in the create/edit screen of the issue, and ideally in bulk update too. What's the best way to do this - develop a custom field or use AJAX / UI validation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "versions not selected" is a nightmare to try in AJAX, and injecting javascript into a Jira UI is the second worst thing you can possibly do to customise a Jira system.
Do this with a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to clarify, I meant AJAX in the edit template of the new custom field type. Not by injecting javascript to the existing version field. Definitely new field type but it is up to you what you do in the edit html ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, if I implement the validation in the class, I know we can use this method:
validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
So the logic is computed inside this method, and returning true/false will tell JIRA to save the data or not? Can I have an example? Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.