Fix "Item not found with ID" error for assigned trigger by adding auto_add parameter #180
+265
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the
issuestrigger withassignedevent type, users encountered "Item not found with ID" errors when passinggithub.event.issue.node_idorgithub.event.issue.idas thecontent_id. This occurred because the issue exists but isn't in the project yet when the assignment event fires.Problem
The action expected issues/PRs to already be in the project, but the assigned trigger often occurs before items are manually added to projects. This resulted in the following error pattern:
Solution
Added an
auto_addparameter (default:false) that automatically adds issues/PRs to the project if they're not already in it. When enabled, the action:addProjectV2ItemByIdGraphQL mutation to add it to the projectUsage
Changes
auto_addinput parameter with backward-compatible default (false)addProjectItem()function using GitHub's Projects V2 APIAlso fixed a case sensitivity bug in
convertValueToFieldType()that was causing number field conversions to fail.The solution maintains full backward compatibility while enabling the assigned trigger workflow that was previously failing.
Fixes #55.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.