Selected project ID

Hello,

I am developing a jira plugin, more exactly a report plugin, I need to fill a dropdown menu where I want to display all the Sprints, my problem is that I don’t know how to do that.
This is what I have so far:

public class GetSprintsForUI implements ValuesGenerator {
    @Override
    public Map getValues(Map map) {
        try {
            Map<String, String> sprintsMap = new HashMap<String, String>();
            SprintQueryServiceImpl service = new SprintQueryServiceImpl();
            JqlQueryBuilder queryBuilder = JqlQueryBuilder.newBuilder();
            Query query = queryBuilder.buildQuery();
            ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
            ServiceOutcome serviceOutcome = service.getSprints(user.getDirectoryUser(), query);
            if (serviceOutcome.getValue() != null) {
                for (Sprint sprint : (List<Sprint>) serviceOutcome.getValue()) {
                    sprintsMap.put(String.valueOf(sprint.getId()), sprint.getName());
                }
                return sprintsMap;
            }
        } catch (Exception e) {
            return null;
        }
        return null;
    }
}

This class should return a map of Sprints(sprint ID and name) but it doesn’t work, does anyone know why? SprintQueryServiceImpl class requires my a query and I don’t know what query to pass.

Thank you :slight_smile: