How do you display the value of a custom field as a column
Asked by Ste404:

Hi there,

I am baffled as how to do something in a very basic chart in Analytics.

I can see in the Issue field table all the custom field names in the Name column. I can set up a filter in a query using this information by filtering for a Name and a Value =.

BUT what I want to do is show the values for issues of a custom field..

Issue Key, Summary, Assignee, Custom field 1, Custom field 2 etc.

How do I add them as a column in the output. If I click Add column and then search for column name the custom fields do not return to be able to be added.

What am I missing here?

Thanks


Answers:
author: Matthew Lempitsky
body: Hi Steven!  

Thanks for your question.   

You're on the right track with regards to setting up a filter with the Name and Values for the custom fields in the Issue Field table. You can read more about that filtering [here](https://confluence.atlassian.com/analyticskb/query-jira-custom-fields-1188411074.html).  

The trick is that each custom field you wish to add to your result set, will need to be it's own query. You can add additional queries to your main query and then choose the join type.   

Here is a quick example of how you could add to custom fields to your main result set:  

![Explore_-_Add_chart.png](https://community.atlassian.com/t5/image/serverpage/image-id/260542i29E6F3BCA575DC9F/image-size/large?v=v2&px=999 "Explore_-_Add_chart.png")  

Hope this helps!  

<br />

comments: author: Ste404
body: ooohh I was so close, was trying to do that exact thing but in the one query which obviously wasn't going to happen.

Thanks for that, makes sense now that I see it and have mocked one out myself.


author: Ste404
body: One question. I have this basic query that produces a bar chart, simple enough.

I have a custom field called ContractOrgs and I want to filter these results to only be three of these specific companies in the list, where do I put the name and value option for that field in this chart setup.![graph.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/260643i24190C348C47C228/image-size/large?v=v2&px=999 "graph.JPG")


author: Matthew Lempitsky
body: Hey Steven,  

Instead you can apply that filter in the Custom Field query and by using an inner join instead of a left join.  

So, in your query where you are returning Contract Orgs, you can add a filter for *value is one of (Org1, Org 2, Org3)
<br />* Then by changing to an inner join only rows where the value matches*is one of (Org1, Org 2, Org3)*will be added to the result set


author: Ste404
body: Thanks for the answer, but I am coming up empty.

If I run query 1 by itself, I get data. If I run query 2 by itself I get data, running it as a whole chart, nada. If I change query 2 to be unaggregated I get no data when combined.![Chart2.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/260849i87E6B158259B2AA8/image-size/large?v=v2&px=999 "Chart2.JPG")

What have I mucked up? (also using the Organisations field but still not getting expected output)


author: Matthew Lempitsky
body: Hey Steven,   

In both queries Issue ID would have to be unaggregated because you need both queries to return the issue id's themselves so that you can join on them.  

If you want to get counts, you can add a [Group \& Aggregation step](https://support.atlassian.com/analytics/docs/group-and-aggregate-functions/) at the end of everything else.


author: Ste404
body: Ah it just is getting confusing.

If I change Issue ID in query 1 to Unaggregated I have to rerun the query and get a Data source returned an error immediately.

Data source returned: Error running query: \[MISSING_AGGREGATION\] org.apache.spark.sql.AnalysisException: \[MISSING_AGGREGATION\] The non-aggregating expression "issue_id" is based on columns which are not participating in the GROUP BY clause. Add the columns or the expression to the GROUP BY, aggregate the expression, or use "any_value(issue_id)" if you do not care which of the values within a group is returned.

I can't get to the next part to even attempt to understand the group and aggregation step.


author: Matthew Lempitsky
body: Hi Steven,  

This is occurring because you have selected **unaggregated** for Issue ID but have selected **group** as the aggregation for "value", those columns will also need to be **unaggregated** .  

Also, if you run into any more issues on this chart, please feel free to open a support ticket here: <https://support.atlassian.com/contact/#/> and select Technical Issues and Bugs and then select Atlassian Analytics as a product. Our team will be happy to dig into these issues with you.


author: Ste404
body: Thanks, I'll look at that aspect of it.

Main issue I have is I feel dumb at the moment with this ? most of the things I try and just not in the doco how I think I can understand them so it's a knowledge wall mainly.

Thanks for the assist, ticket more than likely soon. ?