youtrack-workflow-api-types
v0.2.4
Published
TypeScript definitions for @jetbrains/youtrack-scripting-api
Downloads
24
Readme
JetBrains YouTrack Scripting API TypeScript Definitions
TypeScript definitions for the JetBrains YouTrack Scripting API.
Installation
npm install --save-dev youtrack-workflow-api-typesUsage
Add paths to your project's tsconfig.json with following content:
{
"compilerOptions": {
"checkJs": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"target": "es2021",
"module": "commonjs",
"baseUrl": ".",
"paths": {
"@jetbrains/youtrack-scripting-api": ["node_modules/youtrack-workflow-api-types"],
"@jetbrains/youtrack-scripting-api/*": ["node_modules/youtrack-workflow-api-types/*"]
}
},
"include": [
"**/*.js"
],
"exclude": [
"node_modules"
]
}Generic types
Issue
/**
* Represents an issue in YouTrack.
* @template F The type of the issue fields.
* @template W The type of the workflow.
*/
export class Issue<F extends IssueFields, W extends string> extends BaseEntity IssueWorkItem
/**
* Represents a work item that has been added to an issue.
* @template T The type of the work item.
*/
export class IssueWorkItem<T extends string> extends BaseWorkItem<T>Autogenerated project custom fields and work item types definitions
You can use youtrack-workflow-cli tool to generate project custom fields and work item types definitions.
First, you need to initialize a new project:
npx youtrack-workflow-cli init [project-name]
cd [project-name]
npm install
Then, you can generate types:
npx ytw types [<youtrack-project-short-name>...]License
MIT
