tags:

views:

2253

answers:

7

I want to be able to get a list of issues given a:

Project Name and Release Version

this seems like a basic JIRA soap API 101 request

It seems, looking at the documentation:

http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html

you can get issues by:

  1. Filter
  2. SearchTerms
  3. SearchTerms and Project

but not the above. Is this a complete oversight or i am missing something

i would expect to see something like this:

RemoteIssue[] issues = _soapService.getIssues(string project_, string version_)

any help?


UPDATE: I see that JIRA 4.0 is out but i can't find any documentation if the API has changed to support this request above. Can anyone find this link to answer that questions.

+6  A: 

It's not possible with the current JIRA API. They probably will make it in JIRA 4.0.

In JIRA Client we solved this problem by requesting IssueNavigator.jspa (Find Issues tab) with search conditions in URL and requesting RSS output; then parsing the RSS.

I've explained some of the intricacies of dealing with JIRA remotely, including searching, in this webinar: http://blogs.atlassian.com/news/2008/11/killer_jira_cli.html

Hope this helps

sereda
thanks for the video. it seems surprising that JIRA would make you jump through such hoops. i know on the video you mentioned that you were going to be adding time tracking . .is there any timeframe for this and how would it work ?
ooo
also, how do you find out what is going to be in JIRA 4.0. is the SOAP API going to be extended?
ooo
I do not *know* what's going to be in JIRA 4.0, but there have been talks about JIRA 4 scope with Atlassian, including the search. Since this would be a major upgrade, I think (and hope!) API will be extended. You really should ask Atlassian guys (btw, the best place to do that is Atlassian Summit - http://www.atlassian.com/summit ).
sereda
As for time tracking, we're working on it now, but I can't promise timeframe yet. We'll do it in 1.x series though, before 2.0 is out. If you have any suggestions on how it should look, you're welcome to post on our forum: http://forum.almworks.com
sereda
@sereda - can you explain what you mean by "we solved this problem by requesting IssueNavigator.jspa (Find Issues tab) with search conditions in URL" . .are you parsing HTML ??
ooo
We're requesting RSS and parse XML. In other parts of the application we parse HTML as well.
sereda
@sereda - when i try to get this url over http from my app i get the header but i get a list with no issues. is there some login information needed ?
ooo
@ooo Yes, you need to pass valid JSESSIONID and ASESSIONID cookies (maybe others if you have customized authentication scheme). Otherwise, the result will be as if you access JIRA from the browser without logging in (which may be OK if JIRA is configured to allow anonymous access).
sereda
@ooo Valid cookies can be set manually (just look them up in your browser). If you need your script to survive cookie expiration, then you can implement logging in by posting username/password to the server and then remembering cookie values - just as browser does.
sereda
A: 

There is some comments on the Atlassian JIRA regarding the new methods delivered in JIRA 4.0 http://jira.atlassian.com/browse/JRA-17509

Another issue indicates that the SOAP api is not very high in the priority list. under JRA-7614, and Atlassian is advising to make the modifications yourself.

I also need a more elaborated SOAP API (such as issue linking, ...). Anyone who wants to contribute / help in getting it done, so we can avoid doing 'HTML Screen Scraping' ... (@sereda, thanks for the video btw)

Francis

+1  A: 

It is possible to write a JIRA plug-in to expose the desired methods via SOAP with the RPC Endpoint Plugin Module.

titaniumdecoy
if JIRA doesn't expose this API, i dont think there is any solution. as mentioned, JIRA 4.0 is getting an upgrade in this area
ooo
There is no solution unless you write your own plug-in or modify the existing RPC plugin (the source for which is freely provided).
titaniumdecoy
+1  A: 

I believe you can make a filter which has the traits you want - like project name and release version - then use the soap API to get the list based on that filter, passing it the project name and release version you want. I don't have an example of this off-hand, but I know it is what our app does. The downside is you have to create a filter by hand first, then hard-code its ID somewhere and assume it exists, but if you are willing to be that "ugly". it should work for you.

-Carl

cmyers
thats what we are doing but it stinks :)
ooo
+1  A: 

In JIRA 4 you can use the JIRA Query Language with the SOAP method getIssuesFromJqlSearch.

Kees de Kooter
thanks for the update
ooo
+3  A: 

Not being able to upgrade to Jira 4 anytime soon and with a similar requirement, I retrieved issues by search term and project, kludging a "search term" that seems to work as a wildcard: "- 0 1 2 3 4 5 6 7 8 9". As all generated Issue keys are of the form XXX-YYY where Y is a digit, that should find all issues, albeit probably not efficiently for big projects. You'd then have to iterate through the result checking version numbers.

Not pretty - and I haven't tested this thoroughly yet - but it seems to work.

Thor

Thor Harley
A: 

As for the TimeTracking (sorry, wanted to add a comment to seredas answer, but seems I don't have enough reputation)

We have Jira 4.1.2 running and this works (python2.6 using suds):

>>> client.service.getWorklogs(auth,"PROJ-650")
[(RemoteWorklogImpl){
   author = "philipp"
   comment = None
   created = 2010-07-21 12:46:34
   groupLevel = None
   id = "12651"
   roleLevelId = None
   startDate = 2010-07-21 12:46:00
   timeSpent = "10 minutes"
   timeSpentInSeconds = 600
   updateAuthor = "philipp"
   updated = 2010-07-21 12:46:34
 }]
Philipp Keller