I'm not sure of the structure of your custom field and it's values, but it sounds to me like you may need to write a searcher for it. See https://developer.atlassian.com/display/JIRADEV/JIRA+Plugin+Guide and look for the customfield-searcher module
If the field was a simple string, date, number, etc, and stored normally in Jira like the standard custom fields, you could simply use the most appropriate built-in searcher. But I've a feeling that won't work for your field.
I have next cod to get the CustomField:
String genesisID = "genesisID"; CustomField genesisIDField = fieldManager.getCustomField(genesisID); Object genesisIDValue = genesisIDField.getCustomFieldType().getValueFromIssue(genesisIDField, [WHAT IS HIS ISSUE])
But, I need some code to search the ISSUE ID of the CustomField with value "X".
I'm afraid that's just repeating yourself instead of answering the question.
Could you tell us what TYPE of field you are working with. What TYPE is the field called genesisID?
Once we know that, we will be in a better place to understand "I want to use value X to get the issue of custom field" - that itself sounds wrong to me though - custom fields belong to issues. We'd expect you to be asking "what value is stored for custom field X on issue Y" or "I need to search for issues that have customfield value Y in custom field X", but "use value X to get issue of custom field" just does not make sense.
Good, that means the field has a text searcher associated with it correctly, which gets us most of the way there.
Depends on the context of where you are doing it and why, but here's a starter:
Note that the 10010L in the second line is the custom field's key id, so you'll need to change that to whatever it is for genesisID
That will get you a "search results" object which has some useful info about your search, including a list that contains each issue returned:
You could get it by reading the database - table is customfield.
Jira UI exposes it too - hover the cursor over the admin links or go into one of them for the field, and you'll see an id=xxxxx, or customfield_xxxxx in the urls exposed.
In code, there are functions like fieldManager.getCustomFieldByName("genesisID")
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot