cascading select configuration object doesn't work in jira 7.3.0 reports

 

We need to upgrade jira from 4.1.2 to 7.3.0 version and we've found a bug on report configuration screen, concerning cascadinselect configuration object. We have several reports with 2 select boxes in cascade : 

        <properties>
                <property>
                <key>projectid</key>
                <name>Projects Names</name>
                <description>SELECTION of Project</description>
                <type>select</type>
                <values class="com.eri.jira.reports.ProjectValuesGeneratorEriWithoutAll" />
            </property>
            <property>
                <key>componentid</key>
                <name>Project Components</name>
                <description>SELECTION of Project Component</description>
                <type>cascadingselect</type>
                <values class="com.eri.jira.reports.ComponentsForSpecificProjectGeneratorEri" />
                <cascade-from>projectid</cascade-from>
            </property>        

After installation of our plugin to generate client reports, the screen of report configuration show us the list of projects in select box Projects Names,  but nothing or hidde select box in ProjectComponents select box. See attachment1.png.

reportClient.PNG
We've done some Google research, and we found issue JRASERVER-22613 where cascadingutil.js is mentioned. After vérification this file not exist in JIRA 7.3.0. We've added and including it on system-webresources-plugin.xml but it doesn't change: cascadind selet doesn't work.
Inside Atlassian Community we've found a lot of issues concerning this bug  but no solution yet.

The classes involved in jira report and atlassian-plugin.xml are:



import java.util.Map;
import org.apache.commons.collections.map.ListOrderedMap;
import com.atlassian.configurable.ValuesGenerator;
import atlassian.jira.portal.ProjectValuesGenerator;


public class ProjectValuesGeneratorEriWithoutAll implements ValuesGenerator{

    public Map getValues(Map arg0) {
        @SuppressWarnings("unchecked")
        ProjectValuesGenerator projectValuesGenerator = new ProjectValuesGenerator();
        Map<String, String> values = new ListOrderedMap();
        values.putAll(projectValuesGenerator.getValues(arg0));
        return values;
    }    
}


public class ProjectComponentsValuesGenerator implements ValuesGenerator
{
     private static final Logger log = Logger.getLogger(ProjectComponentsValuesGenerator.class);
    
     public Map getValues(Map userParams)
     {
            GenericValue valueProject =   (GenericValue)userParams.get("project");
            HashMap hashMap = new HashMap(valueProject);
            Object detectedProjectId = hashMap.get("id");
            
            ProjectManager  projectManager  = ComponentAccessor.getProjectManager();
            List<Project> projectObjects = projectManager.getProjectObjects();
            Map<String, ValueClassHolder> values = new LinkedHashMap<String, ValueClassHolder>();
            String key = "";
        
            for (Iterator iterator = projectObjects.iterator(); iterator.hasNext();)
                {
                    Project project = (Project) iterator.next();
                    Collection<ProjectComponent> components =  project.getComponents();
                    key = project.getId().toString();
                    values.put(key+"ERI", new ValueClassHolder("All", key));
                        for(Iterator<ProjectComponent> componentIt = components.iterator(); componentIt.hasNext();)
                          {
                            ProjectComponent projectComponent = componentIt.next();
                            values.put(projectComponent.getId().toString(), new ValueClassHolder(projectComponent.getName(), key));
                          }

                }                
            return values;    
    }
}
The bug is detected with IE 11, Firefox 55.0.3 and Chrome 60.0.312.113


Thanks a lot to solve this situation to start migration

1 answer

You should upgrade Jira Software 7.0 first, before upgrading to Jira Software 7.4

Do you have a reason? We think maybe is a javascript bug on cascading select object configurator that probably it doesn't receive the project selected by the user. The selecte box corresponding to cascading select is hide and there is not trace of user project selection action in the jira log file

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

13,571 views 16 15
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