Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-dev] Programmatically querying Jira using mylyn

Hi all,

In the application I'm currently developing, I'm using the mylyn
tasklist plugin with the Jira connector as an interface to Jira. 

As part of the application, I need to set up some queries
programmatically (i.e., I don't want to go through the mylyn gui). Is
there a way to do that without calling classes and methods directly in
the jira connector packages? It seems to me that I shouldn't need to
know I'm talking to jira directly (not least because all these classes
are in an internal package), but I can't seem to figure out how. This is
how I'm creating queries now:

(notice that most of these classes are in
org.eclipse.mylyn.internal.jira -  is there another way?)

Thanks,

Stefanos



Repository r = getRepository(); //a custom abstraction that includes a
repo kind, location and credentials

TaskListManager manager = TasksUiPlugin.getTaskListManager();
final TaskRepository repo = new TaskRepository(r.getKind(),
r.getLocation());
repo.setAuthenticationCredentials(r.getUserName(), r.getPassword());
repo.setRepositoryLabel(r.getName());
Display.getDefault().syncExec(new Runnable() {
        public void run() {          
          tasksRepoManager.addRepository(repo,
TasksUiPlugin.getDefault()
              .getRepositoriesFilePath());          
        }
      });

AbstractRepositoryQuery inProgressTasks;

FilterDefinition filter = new FilterDefinition("in progress @ "
        + r.getName());
Status inProgressStatus = new Status();
inProgressStatus.setName("In Progress");
inProgressStatus.setId(Status.STARTED_ID);
inProgressStatus.setDescription("Items i'm working on");

filter.setProjectFilter(null);

ContentFilter contentFilter = new ContentFilter("", true, true, false,
        false);

filter.setContentFilter(contentFilter);

filter.setStatusFilter(new StatusFilter(new Status[] {
inProgressStatus,}));

CurrentUserFilter userFilter = new CurrentUserFilter();

filter.setAssignedToFilter(userFilter);

AbstractRepositoryQuery query = new JiraCustomQuery(r.getLocation(),
filter,
        "UTF-8");

manager.getTaskList().addQuery(query);
Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.  The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.

UBS Limited is a company registered in England & Wales under company
number 2035362, whose registered office is at 1 Finsbury Avenue,
London, EC2M 2PP, United Kingdom.

UBS AG (London Branch) is registered as a branch of a foreign company
under number BR004507, whose registered office is at
1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.

UBS Clearing and Execution Services Limited is a company registered
in England & Wales under company number 03123037, whose registered
office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.


Back to the top