mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
fixes done
This commit is contained in:
parent
1dc80e3bdd
commit
8ca31db0aa
|
@ -117,24 +117,6 @@ export const issueFields = [
|
|||
default: '',
|
||||
description: 'Summary',
|
||||
},
|
||||
{
|
||||
displayName: 'Parent Issue Key',
|
||||
name: 'parentIssueKey',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Parent Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
|
@ -152,6 +134,14 @@ export const issueFields = [
|
|||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Parent Issue Key',
|
||||
name: 'parentIssueKey',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: 'Parent Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Labels',
|
||||
name: 'labels',
|
||||
|
@ -226,65 +216,8 @@ export const issueFields = [
|
|||
description: 'Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Issue Type',
|
||||
name: 'issueType',
|
||||
type: 'options',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'update'
|
||||
]
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getIssueTypes',
|
||||
},
|
||||
default: '',
|
||||
description: 'Issue Types',
|
||||
},
|
||||
{
|
||||
displayName: 'Summary',
|
||||
name: 'summary',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Summary',
|
||||
},
|
||||
{
|
||||
displayName: 'Parent Issue Key',
|
||||
name: 'parentIssueKey',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'update',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Parent Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
|
@ -299,6 +232,33 @@ export const issueFields = [
|
|||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Issue Type',
|
||||
name: 'issueType',
|
||||
type: 'options',
|
||||
required: false,
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getIssueTypes',
|
||||
},
|
||||
default: '',
|
||||
description: 'Issue Types',
|
||||
},
|
||||
{
|
||||
displayName: 'Summary',
|
||||
name: 'summary',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: 'Summary',
|
||||
},
|
||||
{
|
||||
displayName: 'Parent Issue Key',
|
||||
name: 'parentIssueKey',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: 'Parent Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Labels',
|
||||
name: 'labels',
|
||||
|
@ -405,10 +365,11 @@ export const issueFields = [
|
|||
description: 'Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Fields',
|
||||
name: 'fields',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
|
@ -419,97 +380,72 @@ export const issueFields = [
|
|||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: `A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values:
|
||||
*all Returns all fields.
|
||||
*navigable Returns navigable fields.
|
||||
Any issue field, prefixed with a minus to exclude.`
|
||||
},
|
||||
{
|
||||
displayName: 'Fields By Key',
|
||||
name: 'fieldsByKey',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
options: [
|
||||
{
|
||||
displayName: 'Fields',
|
||||
name: 'fields',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: `A list of fields to return for the issue. This parameter accepts a comma-separated list.
|
||||
Use it to retrieve a subset of fields. Allowed values:
|
||||
*all Returns all fields.
|
||||
*navigable Returns navigable fields.
|
||||
Any issue field, prefixed with a minus to exclude.`
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: `Indicates whether fields in fields are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID.`,
|
||||
},
|
||||
{
|
||||
displayName: 'Expand',
|
||||
name: 'expand',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
{
|
||||
displayName: 'Fields By Key',
|
||||
name: 'fieldsByKey',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
default: false,
|
||||
description: `Indicates whether fields in fields are referenced by keys rather than IDs.
|
||||
This parameter is useful where fields have been added by a connect app and a field's key
|
||||
may differ from its ID.`,
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: `Use expand to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include:
|
||||
renderedFields Returns field values rendered in HTML format.
|
||||
names Returns the display name of each field.
|
||||
schema Returns the schema describing a field type.
|
||||
transitions Returns all possible transitions for the issue.
|
||||
editmeta Returns information about how each field can be edited.
|
||||
changelog Returns a list of recent updates to an issue, sorted by date, starting from the most recent.
|
||||
versionedRepresentations Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the fields parameter is ignored.`
|
||||
},
|
||||
{
|
||||
displayName: 'Properties',
|
||||
name: 'properties',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
{
|
||||
displayName: 'Expand',
|
||||
name: 'expand',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: `Use expand to include additional information about the issues in the response.
|
||||
This parameter accepts a comma-separated list. Expand options include:
|
||||
renderedFields Returns field values rendered in HTML format.
|
||||
names Returns the display name of each field.
|
||||
schema Returns the schema describing a field type.
|
||||
transitions Returns all possible transitions for the issue.
|
||||
editmeta Returns information about how each field can be edited.
|
||||
changelog Returns a list of recent updates to an issue, sorted by date, starting from the most recent.
|
||||
versionedRepresentations Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the fields parameter is ignored.`
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: `A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values:
|
||||
*all Returns all issue properties.
|
||||
Any issue property key, prefixed with a minus to exclude.
|
||||
Examples:
|
||||
*all Returns all properties.
|
||||
*all,-prop1 Returns all properties except prop1.
|
||||
prop1,prop2 Returns prop1 and prop2 properties.
|
||||
This parameter may be specified multiple times. For example, properties=prop1,prop2& properties=prop3.`
|
||||
},
|
||||
{
|
||||
displayName: 'Update History',
|
||||
name: 'updateHistory',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
],
|
||||
{
|
||||
displayName: 'Properties',
|
||||
name: 'properties',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: `A list of issue properties to return for the issue.
|
||||
This parameter accepts a comma-separated list. Allowed values:
|
||||
*all Returns all issue properties.
|
||||
Any issue property key, prefixed with a minus to exclude.
|
||||
Examples:
|
||||
*all Returns all properties.
|
||||
*all,-prop1 Returns all properties except prop1.
|
||||
prop1,prop2 Returns prop1 and prop2 properties.
|
||||
This parameter may be specified multiple times. For example, properties=prop1,prop2& properties=prop3.`
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: `Whether the project in which the issue is created is added to the user's Recently viewed project list, as shown under Projects in Jira. This also populates the JQL issues search lastViewed field.`,
|
||||
{
|
||||
displayName: 'Update History',
|
||||
name: 'updateHistory',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
default: false,
|
||||
description: `Whether the project in which the issue is created is added to the user's
|
||||
Recently viewed project list, as shown under Projects in Jira. This also populates the
|
||||
JQL issues search lastViewed field.`,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -574,7 +510,6 @@ export const issueFields = [
|
|||
default: 50,
|
||||
description: 'How many results to return.',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* issue:notify */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -596,66 +531,6 @@ export const issueFields = [
|
|||
default: '',
|
||||
description: 'Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Subject',
|
||||
name: 'subject',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'notify',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue key and summary.',
|
||||
},
|
||||
{
|
||||
displayName: 'Text Body',
|
||||
name: 'textBody',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
alwaysOpenEditWindow: true,
|
||||
},
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'notify',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue key and summary.',
|
||||
},
|
||||
{
|
||||
displayName: 'HTML Body',
|
||||
name: 'htmlBody',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
alwaysOpenEditWindow: true,
|
||||
},
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'notify',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The HTML body of the email notification for the issue.',
|
||||
},
|
||||
{
|
||||
displayName: 'JSON Parameters',
|
||||
name: 'jsonParameters',
|
||||
|
@ -673,6 +548,57 @@ export const issueFields = [
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'notify',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Subject',
|
||||
name: 'subject',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: `The subject of the email notification for the issue. If this is not specified,
|
||||
then the subject is set to the issue key and summary.`
|
||||
},
|
||||
{
|
||||
displayName: 'Text Body',
|
||||
name: 'textBody',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
alwaysOpenEditWindow: true,
|
||||
},
|
||||
required: false,
|
||||
default: '',
|
||||
description: `The subject of the email notification for the issue.
|
||||
If this is not specified, then the subject is set to the issue key and summary.`
|
||||
},
|
||||
{
|
||||
displayName: 'HTML Body',
|
||||
name: 'htmlBody',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
alwaysOpenEditWindow: true,
|
||||
},
|
||||
required: false,
|
||||
default: '',
|
||||
description: 'The HTML body of the email notification for the issue.',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Notification Recipients',
|
||||
name: 'notificationRecipientsUi',
|
||||
|
@ -878,10 +804,11 @@ export const issueFields = [
|
|||
description: 'Issue Key',
|
||||
},
|
||||
{
|
||||
displayName: 'Expand',
|
||||
name: 'expand',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
|
@ -892,43 +819,34 @@ export const issueFields = [
|
|||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Use expand to include additional information about transitions in the response. This parameter accepts transitions.fields, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the fields and update fields in Transition issue.',
|
||||
},
|
||||
{
|
||||
displayName: 'Transition ID',
|
||||
name: 'transitionId',
|
||||
type: 'string',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'transitions',
|
||||
],
|
||||
options: [
|
||||
{
|
||||
displayName: 'Expand',
|
||||
name: 'expand',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: `Use expand to include additional information about transitions in the response.
|
||||
This parameter accepts transitions.fields, which returns information about the fields in the
|
||||
transition screen for each transition. Fields hidden from the screen are not returned. Use this
|
||||
information to populate the fields and update fields in Transition issue.`
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'The ID of the transition.',
|
||||
},
|
||||
{
|
||||
displayName: 'Skip Remote Only Condition',
|
||||
name: 'skipRemoteOnlyCondition',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
operation: [
|
||||
'transitions',
|
||||
],
|
||||
{
|
||||
displayName: 'Transition ID',
|
||||
name: 'transitionId',
|
||||
type: 'string',
|
||||
required: false,
|
||||
default: '',
|
||||
description: 'The ID of the transition.',
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Indicates whether transitions with the condition Hide From User Condition are included in the response.',
|
||||
{
|
||||
displayName: 'Skip Remote Only Condition',
|
||||
name: 'skipRemoteOnlyCondition',
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
default: false,
|
||||
description: 'Indicates whether transitions with the condition Hide From User Condition are included in the response.',
|
||||
},
|
||||
],
|
||||
},
|
||||
] as INodeProperties[];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { IDataObject } from "n8n-workflow";
|
||||
|
||||
export interface IFields {
|
||||
summary: string;
|
||||
summary?: string;
|
||||
project?: IDataObject;
|
||||
issuetype?: IDataObject;
|
||||
labels?: string[];
|
||||
|
|
|
@ -219,7 +219,6 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
const projectId = this.getNodeParameter('project', i) as string;
|
||||
const issueTypeId = this.getNodeParameter('issueType', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const parentIssueKey = this.getNodeParameter('parentIssueKey', i) as string;
|
||||
const body: IIssue = {};
|
||||
const fields: IFields = {
|
||||
summary,
|
||||
|
@ -256,12 +255,14 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
subtaskIssues.push(issueType.id);
|
||||
}
|
||||
}
|
||||
if (!parentIssueKey && subtaskIssues.includes(issueTypeId)) {
|
||||
if (!additionalFields.parentIssueKey
|
||||
&& subtaskIssues.includes(issueTypeId)) {
|
||||
throw new Error('You must define a Parent Issue Key when Issue type is sub-task');
|
||||
|
||||
} else if (parentIssueKey && subtaskIssues.includes(issueTypeId)) {
|
||||
} else if (additionalFields.parentIssueKey
|
||||
&& subtaskIssues.includes(issueTypeId)) {
|
||||
fields.parent = {
|
||||
key: parentIssueKey.toUpperCase(),
|
||||
key: (additionalFields.parentIssueKey as string).toUpperCase(),
|
||||
};
|
||||
}
|
||||
body.fields = fields;
|
||||
|
@ -273,33 +274,33 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
}
|
||||
//https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-put
|
||||
if (operation === 'update') {
|
||||
const summary = this.getNodeParameter('summary', i) as string;
|
||||
const issueTypeId = this.getNodeParameter('issueType', i) as string;
|
||||
const issueKey = this.getNodeParameter('issueKey', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const parentIssueKey = this.getNodeParameter('parentIssueKey', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const body: IIssue = {};
|
||||
const fields: IFields = {
|
||||
summary,
|
||||
issuetype: {
|
||||
id: issueTypeId
|
||||
}
|
||||
};
|
||||
if (additionalFields.labels) {
|
||||
fields.labels = additionalFields.labels as string[];
|
||||
const fields: IFields = {};
|
||||
if (updateFields.summary) {
|
||||
fields.summary = updateFields.summary as string;
|
||||
}
|
||||
if (additionalFields.priority) {
|
||||
if (updateFields.issueType) {
|
||||
fields.issuetype = {
|
||||
id: updateFields.issueType as string,
|
||||
};
|
||||
}
|
||||
if (updateFields.labels) {
|
||||
fields.labels = updateFields.labels as string[];
|
||||
}
|
||||
if (updateFields.priority) {
|
||||
fields.priority = {
|
||||
id: additionalFields.priority as string,
|
||||
id: updateFields.priority as string,
|
||||
};
|
||||
}
|
||||
if (additionalFields.assignee) {
|
||||
if (updateFields.assignee) {
|
||||
fields.assignee = {
|
||||
id: additionalFields.assignee as string,
|
||||
id: updateFields.assignee as string,
|
||||
};
|
||||
}
|
||||
if (additionalFields.description) {
|
||||
fields.description = additionalFields.description as string;
|
||||
if (updateFields.description) {
|
||||
fields.description = updateFields.description as string;
|
||||
}
|
||||
const issueTypes = await jiraSoftwareCloudApiRequest.call(this, '/issuetype', 'GET', body);
|
||||
const subtaskIssues = [];
|
||||
|
@ -308,12 +309,14 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
subtaskIssues.push(issueType.id);
|
||||
}
|
||||
}
|
||||
if (!parentIssueKey && subtaskIssues.includes(issueTypeId)) {
|
||||
if (!updateFields.parentIssueKey
|
||||
&& subtaskIssues.includes(updateFields.issueType)) {
|
||||
throw new Error('You must define a Parent Issue Key when Issue type is sub-task');
|
||||
|
||||
} else if (parentIssueKey && subtaskIssues.includes(issueTypeId)) {
|
||||
} else if (updateFields.parentIssueKey
|
||||
&& subtaskIssues.includes(updateFields.issueType)) {
|
||||
fields.parent = {
|
||||
key: parentIssueKey.toUpperCase(),
|
||||
key: (updateFields.parentIssueKey as string).toUpperCase(),
|
||||
};
|
||||
}
|
||||
body.fields = fields;
|
||||
|
@ -326,16 +329,22 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
//https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-get
|
||||
if (operation === 'get') {
|
||||
const issueKey = this.getNodeParameter('issueKey', i) as string;
|
||||
const fields = this.getNodeParameter('fields', i) as string;
|
||||
const fieldsByKey = this.getNodeParameter('fieldsByKey', i) as boolean;
|
||||
const expand = this.getNodeParameter('expand', i) as string;
|
||||
const properties = this.getNodeParameter('properties', i) as string;
|
||||
const updateHistory = this.getNodeParameter('updateHistory', i) as boolean;
|
||||
qs.fields = fields;
|
||||
qs.fieldsByKey = fieldsByKey;
|
||||
qs.expand = expand;
|
||||
qs.properties = properties;
|
||||
qs.updateHistory = updateHistory;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
if (additionalFields.fields) {
|
||||
qs.fields = additionalFields.fields as string;
|
||||
}
|
||||
if (additionalFields.fieldsByKey) {
|
||||
qs.fieldsByKey = additionalFields.fieldsByKey as boolean;
|
||||
}
|
||||
if (additionalFields.expand) {
|
||||
qs.expand = additionalFields.expand as string;
|
||||
}
|
||||
if (additionalFields.properties) {
|
||||
qs.properties = additionalFields.properties as string;
|
||||
}
|
||||
if (additionalFields.updateHistory) {
|
||||
qs.updateHistory = additionalFields.updateHistory as string;
|
||||
}
|
||||
try {
|
||||
responseData = await jiraSoftwareCloudApiRequest.call(this, `/issue/${issueKey}`, 'GET', {}, qs);
|
||||
} catch (err) {
|
||||
|
@ -361,12 +370,15 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
//https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-notify-post
|
||||
if (operation === 'notify') {
|
||||
const issueKey = this.getNodeParameter('issueKey', i) as string;
|
||||
const textBody = this.getNodeParameter('textBody', i) as string;
|
||||
const htmlBody = this.getNodeParameter('htmlBody', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const jsonActive = this.getNodeParameter('jsonParameters', 0) as boolean;
|
||||
const body: INotify = {};
|
||||
body.htmlBody = htmlBody;
|
||||
body.textBody = textBody;
|
||||
if (additionalFields.textBody) {
|
||||
body.textBody = additionalFields.textBody as string;
|
||||
}
|
||||
if (additionalFields.htmlBody) {
|
||||
body.htmlBody = additionalFields.htmlBody as string;
|
||||
}
|
||||
if (!jsonActive) {
|
||||
const notificationRecipientsValues = (this.getNodeParameter('notificationRecipientsUi', i) as IDataObject).notificationRecipientsValues as IDataObject[];
|
||||
const notificationRecipients: INotificationRecipients = {};
|
||||
|
@ -441,19 +453,19 @@ export class JiraSoftwareCloud implements INodeType {
|
|||
throw new Error(`Jira Error: ${JSON.stringify(err)}`);
|
||||
}
|
||||
}
|
||||
https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-transitions-get
|
||||
//https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-transitions-get
|
||||
if (operation === 'transitions') {
|
||||
const issueKey = this.getNodeParameter('issueKey', i) as string;
|
||||
const transitionId = this.getNodeParameter('transitionId', i) as string;
|
||||
const expand = this.getNodeParameter('expand', i) as string;
|
||||
if (transitionId) {
|
||||
qs.transitionId = transitionId;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
if (additionalFields.transitionId) {
|
||||
qs.transitionId = additionalFields.transitionId as string;
|
||||
}
|
||||
if (expand) {
|
||||
qs.expand = expand;
|
||||
if (additionalFields.expand) {
|
||||
qs.expand = additionalFields.expand as string;
|
||||
}
|
||||
if (additionalFields.skipRemoteOnlyCondition) {
|
||||
qs.skipRemoteOnlyCondition = additionalFields.skipRemoteOnlyCondition as boolean;
|
||||
}
|
||||
qs.skipRemoteOnlyCondition = this.getNodeParameter('skipRemoteOnlyCondition', i) as boolean;
|
||||
|
||||
try {
|
||||
responseData = await jiraSoftwareCloudApiRequest.call(this, `/issue/${issueKey}/transitions`, 'GET', {}, qs);
|
||||
responseData = responseData.transitions;
|
||||
|
|
|
@ -101,8 +101,8 @@
|
|||
"dist/nodes/HttpRequest.node.js",
|
||||
"dist/nodes/If.node.js",
|
||||
"dist/nodes/Interval.node.js",
|
||||
"dist/nodes/Intercom/Intercom.node.js",
|
||||
"dist/nodes/Jira/JiraSoftwareCloud.node.js",
|
||||
"dist/nodes/Intercom/Intercom.node.js",
|
||||
"dist/nodes/Jira/JiraSoftwareCloud.node.js",
|
||||
"dist/nodes/LinkFish/LinkFish.node.js",
|
||||
"dist/nodes/Mailchimp/Mailchimp.node.js",
|
||||
"dist/nodes/Mailgun/Mailgun.node.js",
|
||||
|
|
Loading…
Reference in a new issue