tags:

views:

604

answers:

2

Hi all,

I'm currently using the Jira SOAP interface within a C# (I suppose the language used here isn't terribly important).

Basically, I'm creating an API and a Winform that wraps some of the functionality of the soap service so that our Devs can programmaticly add bugs when something goes wrong in our application.

As part of this, I need to know the custom field IDs that are in use in Jira, rather than hardcoding them (as they are still prone to the occasional change) I used the GetCustomFields() method in the jira-rpc api then filtered it, so that all the developer needs to know is the name of the field, then the ID is filled in for them automagically.

This all works fine, but with one quite important proviso: that you login to the SOAP/RPC service as a user with administrative privaliges.

The Jira documentation indicates that the soap/rpc service follows the usual workflows and security schemes, however I can't find anything anywhere that would appear to remove this restriction on enumerating custom fields (and quite why in any instance you would want someone to HAVE to be an administrator to gain this access, especially as the custom field id's tend to be in Jira's HTML source is beyond me)

Does anyone know if I've missed a setting somewhere? Or if there is some sort of work-around for this, short of hardcoding the custom field id's?

Or is this a case of having to delve in to Jira's RPC plugin and modifying the source for it in order to give me the functionality I require?

Cheers

A: 

Worked around this by creating a custom dictionary that logs in as an administrative user, grabs the custom fields and then logs out. Not ideal, but it should work 'til atlassian change things

Lee
A: 

You're not missing anything - there's no way to get custom fields via standard SOAP API.

In JIRA Client, we learn about custom fields in two ways:

  1. We download issues via RSS view of the issue navigator, or via XML representation of a specific issue. If a custom field is set for an issue, the XML will have its id, class and value (values).

  2. From time to time we inspect the content of IssueNavigator search page - looking for searchers for the custom fields. Screen-scraping the HTML gives us not only ids of the custom fields but also possible values for enum fields.

This is hackery, of course, and it may go wrong, so a good API would have been a lot better.

In your case, I can suggest two solutions:

  1. Create your own SOAP (or REST) remote API plugin that will give you just that info that you miss from the standard API. Since you're seemingly in control of your JIRA, you can install anything there.

  2. Screen-scrape the "New Bug" page for the project and type of issue you need to submit. You'll get all the info - fields, options, default values, which field is required.

sereda
You can get the custom fields via the soap API, you just need to be an administrative user to do it
Lee
Yes, but 1) most user don't have admin permissions; 2) you get only field ids and names via SOAP, and that's hardly enough - no field types, no available options.
sereda

related questions