Jira plugins
Jira provides a plugin system that allows developers to extend the functionality of Jira. Developers can create custom plugins that add new features, workflows, or integrations to Jira. Jira plugins are built using Java and can be deployed either as standalone plugins or as part of a larger application.
Here's an example of a simple Jira plugin that adds a custom field to Jira:
package com.example.jiraplugin;
import com.atlassian.jira.issue.fields.CustomFieldManager;
import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
import com.atlassian.plugin.spring.scanner.annotation.export.ExportAsService;
import org.springframework.beans.factory.annotation.Autowired;
import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
import com.atlassian.jira.issue.customfields.manager.GenericConfigManagerImpl;
@ExportAsService ({MyPluginComponent.class})
@Scanned
public class MyPluginComponentImpl implements MyPluginComponent {
@JiraImport
private final CustomFieldManager customFieldManager;
@Autowired
public MyPluginComponentImpl(CustomFieldManager customFieldManager) {
this.customFieldManager = customFieldManager;
}
public void addCustomField(String name) {
customFieldManager.createCustomField(name, "com.atlassian.jira.plugin.system.customfieldtypes:textfield");
}
}
No comments:
Post a Comment