Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Override CustomFieldType edit screen with custom view

I need to create a CustomFieldType with a custom field customisation screen. If I try to create an instance of the default SingleSelectCustomFieldType, the field customisation screen will ask me to provide a name, an optional description and a list of possible values to be selected.

In the plugin I'm writing, I am going to define a new CustomFieldType (say MyCFT), and need to override this screen with a custom screen so that MyCFT instances may be configured the way I want (for instance, I may want to offer the user to select from a dropdown of projects instead of asking a list of possible values).

I tried to read the source for the existing CustomFieldTypes, but could only find the FieldResource class for the REST API, and no way to specify custom velocity templates or soy files for a specific CustomFieldType. Is this feasible or will require "hacks" in order to happen? Has anyone done that before?

Working on JIRA Server 7.4.2, if this helps. Thank you in advance.

1 answer

1 accepted

1 vote
Answer accepted

Hello Jacopo,

You can do that, if I did not misunderstand the question.

First you have to create a ConfigItem class which should implement FieldConfigItemType (com.atlassian.jira.issue.fields.config.FieldConfigItemType)

The FieldConfig variable that is passed to the methods (that you should implement) represents the context of the custom field.

Also you should implement such a method

public String getBaseEditUrl() {
return "EditMyCFTConfig.jspa";
}

and this should be used in a webwork in your atlassian-plugin.xml file

<webwork1 key="mycftconfigaction" name="..." class="java.lang.Object">
<actions>
<action name="com...EditMyCFTConfiguration"
alias="EditMyCFTConfig">
<view name="input">/templates/customfield/mycft/edit-config.vm</view>
</action>
</actions>
</webwork1>

edit-config.xml is the file that you can design any way you want.

Sorry if it is complex, but the process itself is complex and you should read some documents to achieve that.

I hope this may give some clues.

Best

You're right, I finally found some related answers here but the search terms were actually more technical than what I searched. And yes, the process is actually complex and unfortunately not very well documented, so I'm still unsure of what are half of the methods I have to override supposed to provide :D

[EDIT] To be precise, the accepted answer is the way to go, but solves the problem in a different way. Using ConfigItems will NOT "add pages" after choosing name and description for your CustomField. Instead, it will ad a "default" configuration for your additional parameters that you then will have to manually edit by going to the CustomField configuration page and open the relevant WebWorks action page (that was indeed pointed out as the correct way to go). In my research I found no way to add pages to the "create custom field" wizard, therefore I must assume my original idea is unfeasible.

Thank you for your answer.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

455 views 19 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you