Hi there,
im trying to create a custom condition for the SD SLA's.
I followed so far the code from the template plugin of the SD Source package.
Including sla-condition-factory in the atlassian-plugin.xml
My problem is that i get the following Exception
Plugin module de.company.customfield.sla.metric:custom-field-sla-condition-factory threw exception de.company.sla.factory.CustomFieldTimeMetricConditionFactory cannot be cast to com.atlassian.servicedesk.spi.sla.condition.TimeMetricConditionFactory
Thanks for reading this so far
Philipp
Found my answer,
it seems that i included the artifact "jira-servicedesk-api" wrong.
scope=provided was the magical setting
Nice one!
Otherwise you will have a plugin jar file including the servicedesk jar ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Philip,
Why do you use the xml file instead of UI? Can you share your source for the "code from the template plugin of the SD Source package."
Also, can you give me a bit more information about the custom SLA condition you're trying to implement?
Best,
Gökçe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gökçe,
im trying to create a condition for a specific Customfield Value.
Even with an empty Factory i get the Exception.
Best regards,
Philipp
Addition in the atlassian-plugin.xml
<sla-condition-factory key="custom-field-sla-condition-factory" class="de.company.sla.factory.CustomFieldTimeMetricConditionFactory"/>
and the Factory
package de.company.sla.factory;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import com.atlassian.jira.project.Project;
import com.atlassian.servicedesk.spi.sla.condition.TimeMetricConditionFactory;
import com.atlassian.servicedesk.spi.sla.condition.TimeMetricHitCondition;
import com.atlassian.servicedesk.spi.sla.condition.TimeMetricMatchCondition;
import com.google.common.collect.Lists;
public class CustomFieldTimeMetricConditionFactory implements TimeMetricConditionFactory {
public static final String FACTORY_ID = "custom-field-sla-condition-factory";
@Autowired
public CustomFieldTimeMetricConditionFactory() {
}
@PostConstruct
public void onSpringContextStarted() {
}
public List<? extends TimeMetricMatchCondition> getAllMatchConditions(Project project) {
return Lists.newArrayList();
}
public List<? extends TimeMetricHitCondition> getAllHitConditions(Project project) {
return Lists.newArrayList();
}
public TimeMetricMatchCondition getMatchCondition(String id) {
return null;
}
public TimeMetricHitCondition getHitCondition(String id) {
return null;
}
}
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.