# Bug AUTOWORK-401 - Cost Queries do not restrict custom field list/hierarchy options according to block-/allowlist

Project: Stream Workflows & Automations
Status: closed
URL: https://community.openproject.org/work_packages/AUTOWORK-401

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Administration / Custom fields, Modules and project features / Costs and budgets |
| Target versions | 18.0.0 |
| Observed in versions | 18.0.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Klaus Zanders |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Effort (shirt size) |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1. As an administrator, create a work package custom field of the format list with the values "Alpha", "Beta" and "Gamma", and enable it in project A and project B.
2. On the Details tab, set "Project-specific values" to the Allow filter.
3. On the Projects tab, activate "Alpha" for project A and "Beta" for project B. Do not activate "Gamma" anywhere.
4. Log in as a user who is not an administrator and who is a member of project A only, with permissions to view work packages and view time and cost reports.
5. Open the time and costs report of project A.
6. Add a filter on the custom field and open its list of values.

### What is the buggy behavior?

* The filter offers all values of the custom field: "Alpha", "Beta" and "Gamma".
* The same happens with the Block filter: values that are blocked in project A are still offered.
* In the global time and costs report, the filter also offers every value, including values that are not available in any project the user can see.

### What is the expected behavior?

* In the report of project A, the filter only offers the values available in project A and its subprojects, here only "Alpha".
* In the global report, the filter only offers the values available in at least one project in which the user can see work packages.
