βοΈ Exercise 2.1: Ingest Knowledge Using the API
π― Exercise Overview
Go beyond manual upload! In this exercise, you'll use a ready-to-use API to automatically ingest Jira issues into your Dify knowledge base. This approach gives you structured documents with rich metadataβmuch more powerful than plain text files.
β¨ This is the foundation for automated knowledge ingestion. Perfect for teams that want to integrate Jira data into their AI assistants!
π What You'll Build
- Connect to the deployed Jira ingestion API
- Explore available Jira projects using Swagger UI
- Ingest structured Jira issues into your Dify knowledge base
- Compare manual vs. API-based ingestion results

π Step-by-Step Checklistβ
π― Exercise Checklist
β±οΈ Estimated Time: 10-15 minutes | π― Goal: API-ingested knowledge base with structured metadata
π Why Use the API?β
Manually uploading .txt files gives you a starting point, but API ingestion offers superpowers:
- π§ Rich documents with metadata (issue keys, project info, etc.)
- π€ Bulk upload multiple issues at once
- β
Structured data - each document linked to an
issue_key - π§° Automation ready - perfect for pipelines or daily ingestion
- Experiment with JSON ingestion instead of raw
.txt - See how metadata improves search quality
- Reuse this approach at work with real Jira projects

π οΈ Step 1: Get Your Dify Configurationβ
π Configuration Steps
You'll need your Dify instance details to connect the API. Follow these steps:
1.1: Access Your Dify API Settingsβ
In your Dify instance, navigate to Knowledge section
Find and copy your API Server URL
Click the API Key button to create a new API key for your datasets


π§ Pro Tip: Keep your API Server URL and API key handy - you'll need them in the next steps!
π Step 2: Explore Available Projectsβ
π Exploration Steps
Before ingesting data, let's see what Jira projects are available using the interactive Swagger UI.
2.1: Open the API Documentationβ
π Interactive API Documentation
Explore available Jira projects and test API endpoints directly in your browser
π Open Swagger UI β
The Swagger UI provides an interactive interface where you can:
- π Browse all available endpoints
- π§ͺ Test API calls directly in your browser
- π See request/response examples
- π View available projects interactively

π‘ Tip: The Swagger UI is especially helpful if you're new to APIs. You can click "Try it out" on any endpoint to test it without writing curl commands!
π€ Step 3: Ingest Jira Issuesβ
π§ Ingestion Steps
Use the POST /jira/ingest endpoint to ingest specific projects. Leave the dataset_id empty and fill in your Dify configuration.
3.1: Using Command Line (curl)β
Run this command to ingest a project:
curl -X 'POST' \
'https://dify-jira.testingfantasy.com/jira/ingest?advanced_ingestion=false' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"request": {
"project": "REST_JiraEcosystem_issues"
},
"dify_config": {
"dify_base_url": "http://{your_dify_ip}/v1",
"dify_api_key": "{your_dify_api_key}",
"dataset_id": ""
}
}'
{your_dify_ip}β Your Dify instance URL (from Step 1){your_dify_api_key}β Your Dify API key (from Step 1)REST_JiraEcosystem_issuesβ The project you want to ingest (use/projectsendpoint to see all available projects)
3.2: Using Swagger UI (Recommended)β
You can also use the Swagger UI to test the endpoint interactively:
- Navigate to the POST /jira/ingest endpoint in Swagger UI
- Click "Try it out"
- Use this payload:
{
"request": {
"project": "REST_JiraEcosystem_issues"
},
"dify_config": {
"dify_base_url": "http://{your_dify_ip}/v1",
"dify_api_key": "{your_dify_api_key}",
"dataset_id": ""
}
}
- Click "Execute" to run the ingestion

β Step 4: Verify Ingestion in Difyβ
π Verification Steps
After running the ingestion command, verify that your data was successfully uploaded to Dify.
4.1: Check the API Responseβ
The API will return a response showing the ingestion status:
{
"success": true,
"dify_instance": "http://13.38.64.67/v1",
"issues_ingested": 23,
"project": "REST_JiraEcosystem_issues",
"message": "Successfully ingested 23 issues from REST_JiraEcosystem_issues.json"
}
4.2: Verify in Dify Knowledge Baseβ
Navigate to your Dify instance and check the Knowledge section. You should see your newly created knowledge base!


π Success! Your Knowledge Base is Ready
Your Jira issues have been successfully ingested with structured metadata!
π Step 5: Compare Knowledge Base Approachesβ
π¬ Understanding the Differences
In this exercise, you will work with three knowledge bases in Dify:
π Manual Ingestion
Created by uploading .txt files manually. Simple but limited structure and no metadata.
π§ Basic API Ingestion
API-based knowledge base with structured data. Useful for simple lookups and basic retrieval.
π Advanced API Ingestion
Enhanced with query seeding and aliases. Better understanding of user intents and synonyms.
- Manual: Raw text files, limited structure, no metadata
- Basic API: Structured data with metadata (issue keys, project info)
- Advanced API: Query seeding + aliases for better retrieval and understanding
- π
What is this issue about: Jira Issue: REST-259? - π
Give a test plan for REST-266 - π
Who is the assignee for REST-266? - π
Summarize the technical documentation for the REST module.
Notice how having better data and advanced techniques generates better results!


π§ Pro Tip: After uploading, go to Retrieval testing in Dify and try the queries above. Compare the answers you get from each knowledge base. Structured data and advanced techniques enable smarter, more accurate answers!
π What Happens Behind the Scenes?β
π¬ Technical Details
When you ingest Jira issues via the API, here's what happens:
- Each issue is converted into a descriptive document with summary, description, project, type, etc.
- Smart chunking ensures readable chunks with overlap for better search coverage
- Metadata (like
issue_key) is attached to each chunk, improving traceability - Documents are vectorized and indexed in your Dify knowledge base
π§ Advanced: Deploy Your Own API (Optional)β
π Deploy Your Own API Instance
If you want to deploy your own version of the API or understand how it works under the hood:
- Visit https://github.com/bassagap/dify_jira and create a Codespace on the main branch
- Follow the setup instructions to deploy your own instance
- This gives you full control over the API and allows customization
Note: This is optional and only needed if you want to customize the API or understand the implementation details.
π― Exercise Complete! What's Next?β
π Congratulations!
You've successfully ingested Jira issues using the API!
β What You've Accomplished:
- β Connected to the Jira ingestion API
- β Explored available projects using Swagger UI
- β Ingested structured Jira issues with metadata
- β Compared different knowledge base approaches
π Ready for the Next Challenge?
This deployed API is a great next step if you want to:
- π€ Automate ingestion in your organization
- π Connect to real Jira projects
- π§ͺ Test richer search results with structured metadata
- π Compare manual vs. API-based knowledge bases