Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-create-solution-article",
name: "Create Solution Article",
description: "Create a solution article. [See the documentation](https://api.freshservice.com/#create_solution_article)",
version: "0.0.1",
type: "action",
props: {
freshservice,
title: {
type: "string",
label: "Title",
description: "The title of the solution article",
},
description: {
type: "string",
label: "Description",
description: "The description of the solution article",
},
categoryId: {
propDefinition: [
freshservice,
"solutionCategoryId",
],
},
folderId: {
propDefinition: [
freshservice,
"solutionFolderId",
(c) => ({
solutionCategoryId: c.categoryId,
}),
],
},
status: {
propDefinition: [
freshservice,
"solutionArticleStatus",
],
},
articleType: {
propDefinition: [
freshservice,
"solutionArticleType",
],
optional: true,
},
tags: {
type: "string[]",
label: "Tags",
description: "The tags of the solution article",
optional: true,
},
keywords: {
type: "string[]",
label: "Keywords",
description: "The keywords of the solution article",
optional: true,
},
reviewDate: {
type: "string",
label: "Review Date",
description: "Date in future when this article would need to be reviewed again. E.g. `2020-03-29T16:44:26Z`",
optional: true,
},
},
async run({ $ }) {
const { article } = await this.freshservice.createSolutionArticle({
$,
data: {
title: this.title,
description: this.description,
folder_id: this.folderId,
article_type: this.articleType,
status: this.status,
tags: this.tags,
keywords: this.keywords,
review_date: this.reviewDate,
},
});
$.export("$summary", `Successfully created solution article with ID ${article.id}`);
return article;
},
};
60 changes: 60 additions & 0 deletions components/freshservice/actions/create-ticket/create-ticket.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-create-ticket",
name: "Create Ticket",
description: "Create a new ticket. [See the documentation](https://api.freshservice.com/#create_ticket)",
version: "0.0.1",
type: "action",
props: {
freshservice,
source: {
propDefinition: [
freshservice,
"ticketSourceType",
],
},
status: {
propDefinition: [
freshservice,
"ticketStatus",
],
},
priority: {
propDefinition: [
freshservice,
"ticketPriority",
],
},
subject: {
type: "string",
label: "Ticket Subject",
description: "The subject of a ticket",
},
description: {
type: "string",
label: "Ticket Description",
description: "The description of a ticket",
},
email: {
type: "string",
label: "Email",
description: "The email address accociated with the ticket",
},
},
async run({ $ }) {
const { ticket } = await this.freshservice.createTicket({
$,
data: {
source: this.source,
status: this.status,
priority: this.priority,
subject: this.subject,
description: this.description,
email: this.email,
},
});
$.export("$summary", `Successfully created ticket with ID ${ticket.id}`);
return ticket;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-delete-solution-article",
name: "Delete Solution Article",
description: "Delete a solution article. [See the documentation](https://api.freshservice.com/#delete_solution_article)",
version: "0.0.1",
type: "action",
props: {
freshservice,
solutionCategoryId: {
propDefinition: [
freshservice,
"solutionCategoryId",
],
},
solutionFolderId: {
propDefinition: [
freshservice,
"solutionFolderId",
(c) => ({
solutionCategoryId: c.solutionCategoryId,
}),
],
},
solutionArticleId: {
propDefinition: [
freshservice,
"solutionArticleId",
(c) => ({
solutionFolderId: c.solutionFolderId,
}),
],
},
},
async run({ $ }) {
const article = await this.freshservice.deleteSolutionArticle({
$,
articleId: this.solutionArticleId,
});
$.export("$summary", `Successfully deleted solution article with ID ${this.solutionArticleId}`);
return article;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-get-solution-article",
name: "Get Solution Article",
description: "Get a solution article by ID. [See the documentation](https://api.freshservice.com/#view_solution_article)",
version: "0.0.1",
type: "action",
props: {
freshservice,
solutionCategoryId: {
propDefinition: [
freshservice,
"solutionCategoryId",
],
},
solutionFolderId: {
propDefinition: [
freshservice,
"solutionFolderId",
(c) => ({
solutionCategoryId: c.solutionCategoryId,
}),
],
},
solutionArticleId: {
propDefinition: [
freshservice,
"solutionArticleId",
(c) => ({
solutionFolderId: c.solutionFolderId,
}),
],
},
},
async run({ $ }) {
const { article } = await this.freshservice.getSolutionArticle({
$,
articleId: this.solutionArticleId,
});
$.export("$summary", `Successfully fetched solution article with ID ${article.id}`);
return article;
},
};
26 changes: 26 additions & 0 deletions components/freshservice/actions/get-ticket/get-ticket.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-get-ticket",
name: "Get Ticket",
description: "Get a ticket by ID. [See the documentation](https://api.freshservice.com/#view_a_ticket)",
version: "0.0.1",
type: "action",
props: {
freshservice,
ticketId: {
propDefinition: [
freshservice,
"ticketId",
],
},
},
async run({ $ }) {
const { ticket } = await this.freshservice.getTicket({
$,
ticketId: this.ticketId,
});
$.export("$summary", `Successfully fetched ticket with ID ${ticket.id}`);
return ticket;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-list-solution-articles",
name: "List Solution Articles",
description: "List all solution articles. [See the documentation](https://api.freshservice.com/#view_all_solution_article)",
version: "0.0.1",
type: "action",
props: {
freshservice,
solutionCategoryId: {
propDefinition: [
freshservice,
"solutionCategoryId",
],
},
solutionFolderId: {
propDefinition: [
freshservice,
"solutionFolderId",
(c) => ({
solutionCategoryId: c.solutionCategoryId,
}),
],
},
},
async run({ $ }) {
const { articles } = await this.freshservice.listSolutionArticles({
$,
params: {
folder_id: this.solutionFolderId,
},
});
$.export("$summary", `Successfully listed ${articles.length} solution articles`);
return articles;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import freshservice from "../../freshservice.app.mjs";

export default {
key: "freshservice-list-solution-categories",
name: "List Solution Categories",
description: "List all solution categories. [See the documentation](https://api.freshservice.com/#view_all_solution_category)",
version: "0.0.1",
type: "action",
props: {
freshservice,
},
async run({ $ }) {
const { categories } = await this.freshservice.listSolutionCategories({
$,
});
$.export("$summary", `Successfully listed ${categories.length} solution categories`);
return categories;
},
};
Loading
Loading