# Search cases by context attributes using API

**URL:** <https://community.ofelia.com/t/search-cases-by-context-attributes-using-api/8811>\
**Category:** Q&A\
**Created:** [23 October 2017 10:17 UTC](https://community.ofelia.com/t/search-cases-by-context-attributes-using-api/8811 "2017-10-23T10:17:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre.deville](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@pierre.deville](https://community.ofelia.com/u/pierre.deville)\
**Post date:** [23 October 2017 10:17 UTC](https://community.ofelia.com/t/search-cases-by-context-attributes-using-api/8811/1 "2017-10-23T10:17:01Z")

</div>

Hello,

In my use case, each case has a `product_id` which is a business data attribute and related to our internal business logic.

I’m looking for a way to get the `case_id` given a `product_id`.

I did manage to do the other way around, meaning getting the `product_id` given a `case_id` using the case context.

Indeed if I search for the case context I get a response with the form described in the documentation [https://documentation.bonitasoft.com/?hash=retrieve-the-case-context&page=bpm-api#toc25](https://documentation.bonitasoft.com/?hash=retrieve-the-case-context&page=bpm-api#toc25)

I then can get the `storageId` and the `type`and match them with my business data. `storageId` would then match `persistenceId` and `type`, `businessDataType`.

But how can I search cases by context using `storageId` and `type` ?

Thanks for you answers.
