Wednesday, May 14, 2008

Getting the result of all filter in JIRA

Today, I get another new knowledge regarding JIRA stuff. Currently, I am developing a report plugin in JIRA. This afternoon, I got a problem on populating a value of all saved filters in JIRA. These values are used for specifying parameter in the report plugin. However, after doing some research on JIRA source code. I found the following source code which is used for populating parameters in report plugin.

List savedFiltersList = ManagerFactory.getSearchRequestManager().getVisibleRequests(user);
savedFilters = new HashMap();

for (Iterator iterator = savedFiltersList.iterator(); iterator.hasNext();)
GenericValue request = (GenericValue);
savedFilters.put(request.getLong("id").toString(), request.getString("name"));

By returning variable savedFilters, then JIRA will populate the value of select component automatically.

No comments: