JIRA Report (Next and Cancel buttons)

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

This widget could not be displayed.
Andy Nguyen Atlassian Team Jan 06, 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

This widget could not be displayed.
Andy Nguyen Atlassian Team Dec 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

This widget could not be displayed.

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.

This widget could not be displayed.
Andy Nguyen Atlassian Team Jan 02, 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

This widget could not be displayed.

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

This widget could not be displayed.

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;
    }

}

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

181 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you