Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

UserCFType constructor has changed

KONSTANTIN
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2021

Hello!

I have custom field which extends UserCFType :

public class ModifiedByFieldType extends UserCFType {


public ModifiedByFieldType(
@JiraImport CustomFieldValuePersister customFieldValuePersister,
@JiraImport UserConverter userConverter,
@JiraImport GenericConfigManager genericConfigManager,
@JiraImport ApplicationProperties applicationProperties,
@JiraImport JiraAuthenticationContext authenticationContext,
@JiraImport FieldConfigSchemeManager fieldConfigSchemeManager,
@JiraImport ProjectManager projectManager,
@JiraImport SoyTemplateRendererProvider soyTemplateRendererProvider,
@JiraImport GroupManager groupManager,
@JiraImport ProjectRoleManager projectRoleManager,
@JiraImport UserSearchService searchService,
@JiraImport JiraBaseUrls jiraBaseUrls,
@JiraImport UserHistoryManager userHistoryManager,
@JiraImport UserFilterManager userFilterManager,
@JiraImport I18nHelper i18nHelper,
@JiraImport UserBeanFactory userBeanFactor,
@JiraImport FeatureManager featureManager) {


super(customFieldValuePersister, userConverter, genericConfigManager, applicationProperties, authenticationContext, fieldConfigSchemeManager, projectManager, soyTemplateRendererProvider, groupManager, projectRoleManager, searchService, jiraBaseUrls, userHistoryManager, userFilterManager, i18nHelper, userBeanFactor, featureManager);


}

 (code sample for JIRA version > 8.11)

atlassian-plugin.xml:

 

<customfield-type name="Modify By Field"
i18n-name-key="modify-by-field.name"
key="modifybyfield"
class="com.systems.plugins.custom.type.ModifiedByFieldType">
<description>NJII Integrity Modified By User Name</description>
<resource name="view" type="velocity" location="templates/plugins/fields/view/view-basictext.vm"/>
<resource name="edit" type="velocity" location="/templates/service-field-type.template.vm"/>
<resource name="xml" type="velocity" location="templates/plugins/fields/xml/xml-basictext.vm"/>
</customfield-type>

 

Constructor of class com.atlassian.jira.issue.customfields.impl.UserCFType has changed from Jira

version 8.11 (https://docs.atlassian.com/software/jira/docs/api/8.11.0/com/atlassian/jira/issue/customfields/impl/UserCFType.html )

to 8.12

(https://docs.atlassian.com/software/jira/docs/api/8.12.0/com/atlassian/jira/issue/customfields/impl/UserCFType.html)

now it has additional input parameter - FeatureManager.

So, my custom field not going to work for version < 8.12, because of wrong number of input parameters for constructor.

My plugin needs to support  JIRA version below and above 8.11.

Please help!

 

Cheers.

 

1 answer

1 accepted

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
February 18, 2021

Hi @KONSTANTIN I think I saw a presentation where developers used https://developer.atlassian.com/server/framework/atlassian-sdk/spring-java-config/ to have "multi-version" products. I think it was this one: https://www.youtube.com/watch?v=0_lSrVw3TRk

KONSTANTIN
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 23, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__   

Thank you for reply. 

I'm going to use bridge (suggested in atlassian video guide) to manage component for different versions. 

Thanks for help!

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
February 23, 2021

Hi @KONSTANTIN great. I never found a time to test this approach. Is your project private? Or can you share your experience with this publicly? You can always write an article on community and become famous :) for example here... https://community.atlassian.com/t5/Marketplace-Apps-Integrations/bg-p/atlassian-marketplace-articles

jimmy fallon lol GIF by The Tonight Show Starring Jimmy Fallon

Suggest an answer

Log in or Sign up to answer