Skip to main content

Jira

Compatibility

仅在 Node.js 上可用。

¥Only available on Node.js.

本教程介绍如何从 Jira 项目中的问题加载文档对象。

¥This covers how to load document objects from issues in a Jira projects.

凭证

¥Credentials

  • 你需要设置一个访问令牌,并将其与你的 Jira 用户名一起提供,以便对请求进行身份验证。

    ¥You'll need to set up an access token and provide it along with your Jira username in order to authenticate the request

  • 你还需要包含要加载为文档的问题的项目的项目密钥和主机 URL。

    ¥You'll also need the project key and host URL for the project containing the issues to load as documents.

用法

¥Usage

import { JiraProjectLoader } from "@langchain/community/document_loaders/web/jira";

const host = process.env.JIRA_HOST || "https://jira.example.com";
const username = process.env.JIRA_USERNAME;
const accessToken = process.env.JIRA_ACCESS_TOKEN;
const projectKey = process.env.JIRA_PROJECT_KEY || "PROJ";

if (username && accessToken) {
// Created within last 30 days
const createdAfter = new Date();
createdAfter.setDate(createdAfter.getDate() - 30);
const loader = new JiraProjectLoader({
host,
projectKey,
username,
accessToken,
createdAfter,
});

const documents = await loader.load();
console.log(`Loaded ${documents.length} Jira document(s)`);
} else {
console.log(
"You must provide a username and access token to run this example."
);
}

API Reference: