I'm wondering if theres a possibility to add a Custom Field (A Textfield for ex.) to the Create Issue Screen (Default Screen). I already managed this by using the Web-GUI, but now i want to do this with a plugin.
-
Fields in JIRA are added to create, edit or view screens. The screens are defined for each issue type using a screen scheme, then an issue type screen scheme. A plugin would allow you to define a new custom field type, which you would then use to add a new custom field of that type to JIRA.mdoar– mdoar2012-05-02 17:37:32 +00:00Commented May 2, 2012 at 17:37
-
I checked your profile and can't decide if you're a bot or not!mdoar– mdoar2012-05-02 17:38:24 +00:00Commented May 2, 2012 at 17:38
-
Hi, thanks for your Reply. I already added a new custom field type by using a plugin, but actually don't need a new type - i just want to add a checkbox or a plain textfield to the create issue screen. I searched the whole atlassian-docs, but all the examples are using the webgui :/ SebastianSebastian– Sebastian2012-05-03 07:43:52 +00:00Commented May 3, 2012 at 7:43
Add a comment
|
1 Answer
Here's how to add existing custom field to existing screen from your plugin code:
FieldScreenManager fieldScreenManager = ComponentAccessor.getFieldScreenManager();
FieldScreen screen = fieldScreenManager.getFieldScreen(screenID);
FieldScreenTab defaultTab = screen.getTab(0);
defaultTab.addFieldScreenLayoutItem(customFieldID);
Check FieldScreenManager and FieldScreen javadocs for detailed info.