JIRA Report (Next and Cancel buttons)

AbrahamA
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 31, 2013

Hello All

When we create a custom report I see that "Cancel" button always shows up, but next button shows up some times and some times it does not.

Looks like if one of the fields in the input parameters for the Report is empty (Next) button does not show up. Is this expected behavior.

Please let me know.

Thanks

Abe

6 answers

1 vote
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 6, 2014

Hi Abe,

The xml file looks file so I think the issue lies in your Java code. Can you please confirm whether all your projects have at least 1 version or may not have a version? As I can see from the code, you have a condition to check whether "project is null" but do not have a similar condition to check for versions. Would you please verify this?

Regards,

Andy

0 votes
AbrahamA
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.
January 2, 2014

Hello Andy

This is a plugin I am writing. Not sure where is the constriant which does not let me show next button..

Here is the code:

import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.ofbiz.core.entity.GenericValue;

import com.atlassian.configurable.ValuesGenerator;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.project.version.Version;
import com.atlassian.jira.project.version.VersionManager;

public class VersionValuesGenerator implements ValuesGenerator  {

	@Override
	public Map getValues(Map userParams) {
		Map<String, String> versionMap = new LinkedHashMap<String, String>();
		 
        // Get currently selected project
        GenericValue project = (GenericValue) userParams.get("project");
        if (project == null) {
        	AllProjectValuesGenerator.log.debug("VersionValuesGenerator: project is null.");
            return versionMap;
        }
 
        Long projectId = new Long(project.getOriginalDbValue("id").toString());
 
        // Load versions for selected project
        VersionManager versionManager = ComponentAccessor.getVersionManager();
        List<Version> versions = versionManager.getVersions(projectId);
 
        // Sort versions by sequence number
        Collections.sort(versions, new Comparator<Version>() {
            @Override
            public int compare(Version version0, Version version1) {
                return version0.getSequence().compareTo(version1.getSequence());
            }
 
        });
 
        for (Version version : versions) {
            versionMap.put(version.getId().toString(), version.getName());
        }
 
        return versionMap;
    }

}

0 votes
AbrahamA
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.
January 2, 2014

Here is the report component in atlassian-plugin.xml

<report key="project-report" name="Summary Report" class="com.ting.myreports.ProjectSummaryReport">
		<description key="my.report.description" />
		<label key="my.report.label" />
		<resource type="velocity" name="view" location="templates/charting/myproject-report.vm" />
		<resource type="velocity" name="error" location="templates/charting/myproject-error.vm" />
		
		<!-- the properties of this report which the user must select before running it -->
		
		<properties>
			 <property>
				<key>filterId</key>
				<name>Select Filter</name>
				<description>my.report.filter.description</description>
				<type>filterpicker</type>
			</property>
			<property>
				<key>versionID</key>
				<name>Version</name>
				<description> Version for which you would like to generate the	Report.	</description>
				<type>multiselect</type>
				<values	class="com.ting.myreports.values.VersionValuesGenerator" />
			</property>
			<property>
				<key>startDate</key>
				<name>Start Date</name>
				<description>To find issues created on or after this date</description>
				<type>date</type>
			</property>
			<property>
				<key>endDate</key>
				<name>End Date</name>
				<description>To find issues created on or before this date</description>
				<type>date</type>
			</property>
		</properties>
		
	</report>

Thanks

Abe

0 votes
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 2, 2014

Hi Abe,

Did you create this report yourself or import it as a plug-in? In either case, I think there must be a constraint that requires a version to be available before you can release the report. If you're able to edit the report please check this carefully otherwise kinldy contact the provider for further help.

All the best,

Andy

0 votes
AbrahamA
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 31, 2013

Happy New Year Andy and to all friends in this forum.

JIRA Version: 6.0.2

Next Button present since Versions are present in this project


Next button not present, since versions are not present in this project

If I add a version to this project, then next button shows up.

For me even if versions are not there I would like next button to be shown so that I can build report with remaining conditions (Ex: A filter may be chosen). If a filter is chosen I will ignore rest. If filter is not chosen I will build report based on available selections for this project.

0 votes
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 31, 2013

Hi Abe,

Would you please provide a screenshot of the report configuration page and indicate the version of JIRA you're using?

Cheers,

Andy

Suggest an answer

Log in or Sign up to answer