# Forge repo instructions - 06-use-product-context-solution

**URL:** <https://community.developer.atlassian.com/t/forge-repo-instructions-06-use-product-context-solution/103133>\
**Category:** Forge\
**Created:** [October 6, 2026, 7:28am UTC](https://community.developer.atlassian.com/t/forge-repo-instructions-06-use-product-context-solution/103133 "2026-10-06T07:28:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaterinaCurti](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/caterinacurti/32/42270_2.png) [@CaterinaCurti](https://community.developer.atlassian.com/u/CaterinaCurti)\
**Post date:** [October 6, 2026, 7:28am UTC](https://community.developer.atlassian.com/t/forge-repo-instructions-06-use-product-context-solution/103133/1 "2026-10-06T07:28:27Z")

</div>

# **Use the work item summary as the dog breed**

Make the dog breed dynamic by capturing the work item summary. We’ll utilize the product context data to get the work item details and pass them to the API call.

## **Utilize the product context in the resolver**

1. In `src/resolvers/index.js`, update the `getDogInfo` definition to reference the `context` argument

2. Pass `context` to the `fetchDogInfo` function

3. Update `fetchDogInfo` function by adding a parameter to handle `context`

4. In `fetchDogInfo` get the issue ID from the context parameter

## **Call a Jira product REST API to get the summary**

1. To call a product REST APIs, we need to import first add it to the import `api` and `route` in the `src/resolvers/index.js`

2. Create a function called `getIssueSummary` that will return the issue summary given an issue ID. We’ll use the user’s context via `asUser` and calling the convenience method `requestJira` to get the information we need from Jira.

3. Call `getIssueSummary` in the `fetchDogInfo` function, and assign the response to our existing `breedName` variable.

## **Deploy the changes**

1. Deploy the changes by running this Forge CLI command in your terminal / command line

2. You will get an error, **as expected**. Let’s fix that using the linter

3. Check your `manifest.yml` and verify if the necessary scope `read:jira-work` has been added

4. Now that the error has been fixed, you can now proceed with the deployment and installation upgrade. Since there are changes with the permissions that would trigger a major version update, let’s add that `approve` flag to the deployment.

5. Once installation upgrade is done, verify that your app is working as expected. **NOTE** If your work item summary is a valid dog breed that exists in API Ninjas list, then you will see your dog together with the details, otherwise, it will be an empty panel.

## **Bonus exercise**

1. Let us add error handling when the dog breed does not exist. In `src/resolvers/index.js`, update `fetchDogInfo` to verify if there is a valid API response. Add this code snippet between parsing the response and returning `dogInfo`,

2. Save the changes and do a `forge deploy` in your terminal.
