Integration Of Greenhopper with Jira soap Service to retrieve Rank for the Issues or for projects at programmtic level

Hemavathi Kammar July 31, 2012

I am trying to Use Greenhopper JiraUtil and RankService , RankIndex classes to retrieve the rank.But i am getting "RemoteIssue" object from JiraSoapService.How to convert the RemoteIssue object to Jira Issue object(com.atlassian.jira.issue ).

How to configure Greenhopper in Jira using SoapService.

We have Jira4.4.5 api jar.But we are not able to locate the following classes.

Ex: com.atlassian.jira.web.action.greenhopper.SetupGreenHopper

com.atlassian.jira.issue.managers.DefaultIssueManager

com.atlassian.jira.bc.issue.DefaultIssueService

Appreciate your help in this regard.

I am trying to do it programmatically using greenhopper5.8.jar and Jira-api4.4.5.jar.

5 answers

0 votes
Hemavathi Kammar August 6, 2012

i have gone through the documentation.

Currently we are using 4.4.5 Jira api.

I am trying retrieve fields for all issues under project test with priority "urgent".It just returns the self(Url for issue link) and the issue id.As per the documentation we need to use "fields" and expand query parameters to get the required fields.

But the URI is not giving any error,result.

As per the documentation only Jira 5.0 and above will support these parameters.Otherwise we need to fetch issue details in separate http requests which is very costly and slow in the application.

Please confirm that 4.4.5 doesnt provide any facility to get the details for multiple issues in one single request.

Thanks ,

Hema

sclowes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2012

I can't confirm that one way or another. The documentation seems to show that there is no way to do this. If you'd like to confirm I'd recommend that you download the JIRA source code and check it out. The JIRA source is available to all commerical licensees (i.e not $10 starter licenses) via their https://my.atlassian.com login.

Thanks,
Shaun

0 votes
Hemavathi Kammar August 5, 2012

Thanks for ur help.I am able to retrieve the rank.

I am trying to pass jql to get the details for all issues for one project in single http request.is it possible?

I am getting only jira numbers but not all details.Please let me know how to retrieve all detais for multiple issues at one time.

sclowes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2012

Please consult the documentation, this is well covered.

To run a search use the /rest/api/2/search endpoint. Use the "fields" query parameter to specify which fields should be returned. Use the "expand" query parameter to specify which fields should be expanded.

You cannot normally get all results at once, the default is a maximum of 200 results for each query. Use the "startAt" and "maxResults" query parameters to get further results.

Thanks,
Shaun

0 votes
sclowes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2012

I'm not 100% sure what you're asking here. The Rank field is just another JIRA custom field, it can be queried for an issue using the REST interface in the same way as another field.

For example, here's the output of listing the custom fields using /rest/api/2/field from jira.atlassian.com:

[
   ...
   {
      "id":"customfield_11431",
      "name":"Rank",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "schema":{
         "type":"array",
         "items":"string",
         "custom":"com.pyxis.greenhopper.jira:gh-global-rank",
         "customId":11431
      }
   },
   ...
]

You can then just query that field for an issue, here's an example of using with the /rest/api/2/issue interface on issue GHS-5000 from jira.atlassian.com:

{
   "expand":"renderedFields,names,schema,transitions,operations,editmeta,changelog",
   "id":"180088",
   "self":"https://jira.atlassian.com/rest/api/2/issue/180088",
   "key":"GHS-5000",
   "fields":{
      "description":"Error with dialog being undefined.",
      "customfield_11431":"128147"
   }
}

The 128147 is the global rank of the issue.

Hope that helps,
Shaun

Hemavathi Kammar August 2, 2012

Thanks for your help.Please let us know how to authenticate the REST uri.How to pass username and password to get a particular issue.

ex: "https://host:port/jira/rest/api/latest/user/"+"username";

sclowes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2012

Please check out the documentation for information on authenticating.

The very simplest approach is to use os_username and os_password query parameters in your URL.

Thanks,
Shaun

Kiran Patel July 18, 2014

How can edit this rank relative to other issues?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 18, 2014

See the answers above really.

Kiran Patel July 18, 2014

I have an interface wherein a list of issues with their relative ranks are shown, and I want to add the functionality of moving an issue over another and on backend the relative ranks should change..

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 18, 2014

You'll need to query Jira for the ranks of the issues, work out the new values and post them back.

0 votes
Hemavathi Kammar August 1, 2012

We have our own customized Jira Application.We are using JiraSoapService to manage issues.I want to display the Rank as shown below in my application.In the tabel below.Now we have started using REST service.We want to retrieve the Rank stored in Greenhopper database for that particular issue and show it on our application.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2012

I'm not clear on what you are doing here, sorry.

SOAP is a service that exposes *some* Jira stuff to external systems, so I don't understand why you are messing around with greenhopper and Jira api jar files. They're not going to do anything unless you're coding inside Jira (i.e. not using SOAP).

Could you explain the end goal (e.g. "my external system needs to read the ranking field for a range of issues")?

Also, I should mention that SOAP is deprecated, and it's worth looking at REST instead.

Suggest an answer

Log in or Sign up to answer