Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #214 from JupiterOne/INT-10020-2
Browse files Browse the repository at this point in the history
Add logs for the specific ticket
  • Loading branch information
Gonzalo-Avalos-Ribas authored Dec 6, 2023
2 parents c22eecf + 7fbca6e commit 590398a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/converters/IssueEntityConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,33 @@ export function createIssueEntity({
const customFields: { [key: string]: any } = {};

for (const [key, value] of Object.entries(issue.fields)) {
if (key.startsWith('customfield_') && value && fieldsById[key]) {
//TEMP INT-10020
if (key.includes('customfield_12253')) {
if (value !== undefined && value !== null) {
logger.info({}, 'Value not null');
}
logger.info({ startsWith: key.startsWith('customfield_') }, 'StartsWith');
logger.info({ hasKey: fieldsById[key] !== undefined }, 'HasKey');
const fieldName = camelCase(fieldsById[key].name);
logger.info(
{
includes:
customFieldsToInclude.includes(key) ||
customFieldsToInclude.includes(fieldName),
},
'Includes',
);
logger.info(
{ extractedValue: extractValueFromCustomField(value) },
'Extracted value',
);
}
if (
key.startsWith('customfield_') &&
value !== undefined &&
value !== null &&
fieldsById[key]
) {
const fieldName = camelCase(fieldsById[key].name);
if (
customFieldsToInclude.includes(key) ||
Expand Down
2 changes: 2 additions & 0 deletions src/steps/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ export async function fetchIssues({

const apiClient = createApiClient(logger, config);
const fieldsById = await fetchJiraFields(apiClient);

logger.info(
{ customFields: config.customFields, allfields: Object.keys(fieldsById) },
'Custom fields to ingest.',
);

const issueProcessor = async (projectKey: JiraProjectKey, issue: Issue) =>
processIssue(
{
Expand Down

0 comments on commit 590398a

Please sign in to comment.