You could use Jelly script:
https://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jira:CreateCustomField
hope it helps.
Thanks Nic Brough & Udo Brand can you please share the some links or any document to write the custom plugin for jira 1- automatically create the custom field and Associate the field to the appropriate screens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a plugin development you might start here: https://developer.atlassian.com/display/JIRADEV/JIRA+Plugin+Guide. However Jelly script can of course also add a field to a screen: https://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jira:AddFieldToScreen Since I have not developed a plugin by myself I'm not sure if it's worth the time unless you want to add custom fields frequently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd seriously reconsider the design here - is it *really* worth going through the process of researching and writing code for a plugin to add a couple of custom fields that you could just document for the end-user? If your argument is "but I need lots of custom fields", then I'd say that's a bad requirement - having lots of custom fields is a bad idea on many levels, and you probably need to re-evaluate it. (There is only one strong argument for "create custom field in a plugin" that I can think of, but I suspect it's not one you actually have)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you added the custom field to the screen?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Udo Brand & Nic Brough I am able to create as well Add custom field automatically using custom plugin code : Add in the atlassian-plugin.xml: <!-- import from the product container --> <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/> <!-- Add custom field by java code --> <customfield-type key="admintextfield" name="Admin Editable Text Field" class="com.atlassian.jira.plugin.customfield.example.JiraCustomField"> <resource type="velocity" name="edit" location="templates/edit-jiraadminonlytext.vm"/> <description>Text field </description> </customfield-type> My edit-jiraadminonlytext.vm #controlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters.noHeader) <input type="textarea" name="$customField.id" value="$!value" /> #set ($displayValue = ${value}) #controlFooter ($action $fieldLayoutItem.fieldDescription $displayParameters.noHeader) My java Class File : JiraCustomField.java customFieldList = ComponentAccessor.getCustomFieldManager().createCustomField("MycustomField", "customField", field.getCustomFieldType(), field.getCustomFieldSearcher() ,null, field.getAssociatedIssueTypes()); Problem statement: Above code create a custom field (name = "MycustomField"). I am set the value of MycustomField at the time of issue creation but value of MycustomField is not shown in the bug screen Thanks in Advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Depends on what you mean.
You have phrased the question in a slightly ambiguous way (the wonders of the English language - even simple sentences can be immensely unclear).
It sounds like you want to add a new custom field. But a lot of people who ask that actually mean "How do I add data to a custom field", and that's a very different answer.
If you do really mean add a new custom field, then yes, of course you can, but you can only do it in a plugin that has direct access to the internals, or, as Udo has said, with a Jelly script. You also need admin rights for the process you're running. It's also not something you need to do often enough to justify coding it - almost every addon I know of that needs you to add custom fields simply puts "add custom field X" in the "How to install and use me" documentation.
If you do mean "set the data", then you've got a lot more options - Jelly and code in a plugin are still valid approaches, but you can also use REST, web hooks, external programs, tricks in the UI and and and...
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.