Skip to content

Commit

Permalink
Rename destination flag to use_projects_as_boards
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaslcoulougian committed Feb 18, 2025
1 parent 79b218b commit 5e92ecf
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"const": "Jira",
"order": 0
},
"use_board_ownership": {
"use_projects_as_boards": {
"type": "boolean",
"title": "Use Board Ownership",
"description": "Use Jira boards for assigning owners of tasks, or use projects.",
"default": true
"title": "Use Projects as Boards",
"description": "Deprecated: Use default behaviour (disabled) and sync Jira boards. When enabled, Jira project boards are not synced and each project has a single board with the project UID and all issues.",
"default": false,
"deprecated": true
},
"truncate_limit": {
"type": "integer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class BoardIssues extends JiraConverter {
record: AirbyteRecord,
ctx: StreamContext
): Promise<ReadonlyArray<DestinationRecord>> {
if (!this.useBoardOwnership(ctx)) return [];
if (this.useProjectsAsBoards(ctx)) return [];
const issue = record.record.data;
const source = this.initializeSource(ctx);
const relation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Boards extends JiraConverter {
record: AirbyteRecord,
ctx: StreamContext
): Promise<ReadonlyArray<DestinationRecord>> {
if (!this.useBoardOwnership(ctx)) return [];
if (this.useProjectsAsBoards(ctx)) return [];
const board = record.record.data;
const uid = board.id.toString();
const source = this.initializeSource(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const JiraStatusCategories: ReadonlyMap<string, string> = new Map(
export interface JiraConfig {
additional_fields_array_limit?: number;
exclude_fields?: string[];
use_board_ownership?: boolean;
use_projects_as_boards?: boolean;
truncate_limit?: number;
source_qualifier?: string;
}
Expand Down Expand Up @@ -91,8 +91,8 @@ export abstract class JiraConverter extends Converter {
return str;
}

protected useBoardOwnership(ctx: StreamContext): boolean {
return this.jiraConfig(ctx).use_board_ownership ?? false;
protected useProjectsAsBoards(ctx: StreamContext): boolean {
return this.jiraConfig(ctx).use_projects_as_boards ?? true;
}

protected convertAdditionalFieldsIssue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class FarosIssues extends JiraConverter {
},
});

if (!this.useBoardOwnership(ctx)) {
if (this.useProjectsAsBoards(ctx)) {
results.push({
model: 'tms_TaskBoardRelationship',
record: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export class FarosSprintReports extends JiraConverter {
const results: DestinationRecord[] = [];
const source = this.initializeSource(ctx);
const projectKey = sprintReport.projectKey;
// If the project key is provided and use_board_ownership enabled, we use it as board uid.
// If the project key is provided and use_projects_as_boards is enabled, we use project as board uid.
const board =
projectKey && this.useBoardOwnership(ctx)
projectKey && this.useProjectsAsBoards(ctx)
? {uid: projectKey, source}
: {uid: boardUid, source};
for (const issue of sprintReport.issues || []) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export class FarosSprints extends JiraConverter {
const sprint = record.record.data;
const source = this.initializeSource(ctx);
const uid = toString(sprint.id);
// If the project key is provided and use_board_ownership enabled, we use it as board uid.
// If the project key is provided and use_projects_as_boards is enabled, we use project as board uid.
const board =
sprint.projectKey && this.useBoardOwnership(ctx)
sprint.projectKey && this.useProjectsAsBoards(ctx)
? {uid: sprint.projectKey, source}
: {uid: toString(sprint.boardId), source};
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export class Issues extends JiraConverter {
project: {uid: issue.projectKey, source},
},
});
if (!this.useBoardOwnership(ctx)) {
if (this.useProjectsAsBoards(ctx)) {
results.push({
model: 'tms_TaskBoardRelationship',
record: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Projects extends JiraConverter {
source,
},
});
if (!this.useBoardOwnership(ctx)) {
if (this.useProjectsAsBoards(ctx)) {
results.push(
{
model: 'tms_TaskBoard',
Expand Down

0 comments on commit 5e92ecf

Please sign in to comment.