Cannot find NumberCFType class when developing plugin with Atlassian SDK

Vinh-Thach Nguyen December 6, 2012

In a java file of my plugin I could not figure out how to correctly import the class NumberCFType

import com.atlassian.jira.issue.customfields.impl.NumberCFType;

I got error when I run atlas-run

cannot find symbol

symbol : class NumberCFType

location: package com.atlassian.jira.issue.customfields.impl

However import com.atlassian.jira.issue.customfields.impl.TextCFType; works for me.

I use the lastest SDK with JIRA 5.1.8

2 answers

1 accepted

6 votes
Answer accepted
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2012

Does you pom import the jira-core api's, note: This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x ?

<dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

0 votes
Vinh-Thach Nguyen December 10, 2012

In order to avoid jira-core I guess I will have to use the AbstractSingleCFType instead of NumberCFType. As I know nothing about java I would appreciate if someone can help rewrite this code below

public class UniqueIssueId extends NumberCFType {
    public UniqueIssueId(CustomFieldValuePersister customFieldValuePersister,
            DoubleConverter doubleConverter,
            GenericConfigManager genericConfigManager) {
        super(customFieldValuePersister, doubleConverter, genericConfigManager);
    }

    public Double getValueFromIssue(CustomField field, Issue issue) {
        return issue.getId().doubleValue();
    }
}

with AbstractSingleCFType

public class UniqueIssueId extends AbstractSingleCFType {
  ...
  ...
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events