Skip to content

Commit

Permalink
Debugging triggering issue on set-start-end-date
Browse files Browse the repository at this point in the history
  • Loading branch information
Belle P authored and Belle P committed Nov 20, 2024
1 parent cce01c1 commit 1d15660
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/set-start-end-date-issue-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
... on ProjectV2 {
fields(first: 20) {
nodes {
__typename # to know the type of the field
... on ProjectV2SingleSelectField {
id
name
Expand All @@ -31,6 +32,10 @@ jobs:
name
}
}
... on ProjectV2Field {
id
name
}
}
}
}
Expand All @@ -42,8 +47,8 @@ jobs:
// Extract the necessary field IDs dynamically
const statusField = projectData.node.fields.nodes.find(field => field.name === 'Status');
const startDateField = projectData.node.fields.nodes.find(field => field.name === 'Start Date');
const endDateField = projectData.node.fields.nodes.find(field => field.name === 'End Date');
const startDateField = projectData.node.fields.nodes.find(field => field.name === 'Start Date' && field.__typename === 'ProjectV2Field');
const endDateField = projectData.node.fields.nodes.find(field => field.name === 'End Date' && field.__typename === 'ProjectV2Field');
if (!statusField || !startDateField || !endDateField) {
console.log('One or more required fields (Status, Start Date, End Date) not found.');
Expand Down Expand Up @@ -105,7 +110,7 @@ jobs:
console.log(`Issue status: ${statusFieldValue}`);
// Step 3: Update Start Date for "In Progress" status
if (statusFieldValue === 'In progress') {
if (statusFieldValue === 'In Progress') {
console.log(`Updating Start Date for issue ${issueNodeId}`);
await github.graphql(`
mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: String!) {
Expand Down Expand Up @@ -154,4 +159,4 @@ jobs:
});
console.log(`End date set to ${now} for issue.`);
}
}

0 comments on commit 1d15660

Please sign in to comment.