Epic Sum Up provides it's user with a Java API. You can use this API to extract data from Epic Sum Up to use with other business components however needed. 

This enables vast varieties of customization.

To access this data you can use a script extension like Scriptrunner within your Jira instance. 


We do support the following provider classes and functions:


The ProgressResolutionResult is a class that can be used to display the progress of issues. It contains the amount of issues as well as the number of resolved or unresolved issues.


Code Example: Accessing the number of resolved issues
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser;
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import aptis.plugins.epicSumUp.api.ProgressProvider
import aptis.plugins.epicSumUp.api.model.ProgressResolutionResult
@WithPlugin("aptis.plugins.epicSumUp")
@PluginModule
ProgressProvider progressProvider

ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
ProgressResolutionResult progress = progressProvider.getProgressByResolution(
event.issue,
currentUser
);

return progress.getResolved();


You can use any of the following functions to get the result you need:

functionOutputexplanation
Integer getTotal();5Number of all issues in this scope
Integer getResolved();1Number of all issues in this scope with status resolved
Integer getUnresolved();4Number of all issues in this scope with status unresolved


The ProgressNumberWithStatusResult can be used to process the results of number custom fields (e.g. StoryPoints).

In contrast to ProgressResolutionResultProgressNumberWithStatusResult will return a decimal number and even a budget, if possible.


Code Example: Accessing the number of Story Points within resolved issues
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import aptis.plugins.epicSumUp.api.ProgressProvider
import aptis.plugins.epicSumUp.api.model.ProgressNumberWithStatusResult
@WithPlugin("aptis.plugins.epicSumUp")
@PluginModule
ProgressProvider progressProvider

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
CustomField storyPointsField = customFieldManager.getCustomFieldObject("customfield_10106")

ProgressNumberWithStatusResult progress = progressProvider.getNumberProgress(
event.issue,
storyPointsField,
currentUser
);

return (double)progress.getResolved();


You can use any of the following functions to get the result you need:

functionOutputexplanation
Double getTotal();5.0Process the result of all number fields in a given scope
Double getResolved();1.0Process the result of all number fields of resolved issues in a given scope
Double getUnresolved();4.0Process the result of all number fields of unresolved issues in a given scope
Double @Nullable getBudget();15.5Process the budget of the given issue(s)
String getText();5 / 10Process the number of values in resolved issues in relation to the total number

ProgressTimeResult is used to access values that are specifically used as time values.


Code Example: Return the time spent within issues
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser;
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import aptis.plugins.epicSumUp.api.ProgressProvider
import aptis.plugins.epicSumUp.api.model.ProgressTimeResult
@WithPlugin("aptis.plugins.epicSumUp")
@PluginModule
ProgressProvider progressProvider

ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
ProgressTimeResult progress = progressProvider.getTimeProgress(
event.issue,
currentUser
);
return (long)progress.getTimeSpent();


You can use any of the following functions to get the result you need:

functionOutputexplanation
Long getTimeSpent();Time in secondsProcess the result of all number fields in a given scope
Long getOriginalEstimate();Time in secondsProcess the result of all number fields of resolved issues in a given scope
Long getRemainingEstimate();Time in secondsProcess the result of all number fields of unresolved issues in a given scope
Long @Nullable getBudget();Time in secondsProcess the budget of the given issue(s)


When using JMCF, you have to define the progressProvider as follows:


	def progressProvider = getComponent(ProgressProvider.class);