getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.07k stars 4.35k forks source link

JQL cannot return child custom field value #3340

Open sebv004 opened 5 years ago

sebv004 commented 5 years ago

Issue Summary

Cannot display JQL result with customfield type like radiobutton, list single, list multiple, ...

Steps to Reproduce

  1. Create a customfield in JIRA like "Select List (cascading)". Setup the field behaviour "options" with values.
  2. Create Jira issue and choose the value in list.
  3. Create in redash a new jql query like:
    {
    "fields": "summary,priority,customfield_xxxx",
    "jql": "project = \"xxxx Service Desk\""
    }

    The column appears in the result set but there is no value.

For example, here is what I get with postman with a get on : https://myhost/rest/api/2/search?jql=issuekey=LSD-31401

"customfield_13592": {
"self": "https://myhost/rest/api/2/customFieldOption/14340",
"value": "Software",
"id": "14340",
"child": {
"self": "https://myhost/rest/api/2/customFieldOption/14372",
"value": "MySoftwareValueChild",
"id": "14372"
}

As you can see the customfield value is “MySoftwareValueChild”.

To search for this kind of value in jira, I use jql cascadeOption() function , first value is the parent and second value is the child value. See https://confluence.atlassian.com/jiracoreserver073/advanced-searching-functions-reference-861257222.html#AdvancedSearchingFunctions-cascadeOption%28

Technical details:

arikfr commented 5 years ago

Thanks, @sebv004 for the detailed report. Aside from the fact that it comes back completely empty, why do you expect the value to be MySoftwareValueChild and not Software or both them?

sebv004 commented 5 years ago

Hi Arik, The expected behavior should be to have the ability to get parent value and the child value. And to be able to query regarding both parent and child value like jql cascadeOption() function does.

sebv004 commented 5 years ago

Hi, is there any news regarding this issue ? Have you been able to reproduce it ?

arikfr commented 5 years ago

@sebv004 I'm sorry but this is very low priority for us at the moment compared to other projects.

We are always happy to accept pull requests 🙇

arikfr commented 5 years ago

Hi,

I recently looked into a similar issue for a customer and noticed that the custom field value can be referenced using fieldMapping:

{
    "fields": "summary,priority,customfield_xxxx",
    "jql": "project = \"xxxx Service Desk\"",
    "fieldMapping": {
      "customfield_xxxx.value": "friendly_name"
    }
}

The caveat here is that it allows only one level deep, so you can't still reference the child field. That is unless there is a way in the query to return it as a top level field. Do you know if it's possible?

Anyway I'm updating the issue title.

sebv004 commented 5 years ago

Yes, I can retrieve the first level but the value is the less revelant :) I really need this, so I m trying to get the result in sql now which is painful XD