Cannot programmatically add multiple issues to a Github Project


#1

I’m trying to create a migration tool to help people move from Zenhub to Github Projects. As the final step of this process, I’m programmatically creating cards on the API. This appears to work, in that each column shows the correct number of issues; however, only the first 1 or 2 issues that were added are actually displayed when you view the project. This is not the case with manually added cards. Additionally, the script-created cards don’t preserve the order in which they were created - is this intentional? Do I have to use the Move method to ensure correct positioning?

You can see exactly what I’m doing here (the entry point / where the API is used is here).
Am I doing something wrong?

Thanks!


#2

:wave: @sahiltalwar88,

While I’m not positive, I believe this may be the same race condition that we’re seeing over in this post.

We’ll do some research on our end and follow up when we have more information or a solution.


#3

:wave: @bswinnerton,

Thanks for the reply! Sounds good, please keep me in the loop; I’ll be happy to test it out again when you think you’ve deployed a fix. Alternately, please feel free to use my script to test, if you prefer; I have no objections.

Thanks again!


#4

I am getting this issue too - it happens with project cards added via the API.

Some interesting notes:

  • I am not seeing the error message as described here.
  • When calling GET /projects/columns/:column_id/cards, the cards that were successfully added are missing from there also.
  • When I try to add a new project card linked to an issue which I have already added (but doesn’t show up in the GET from above), I get the following response:
code: 422
message: "{"message":"Validation Failed","errors":["Project already has the associated issue"],"documentation_url":"https://developer.github.com/v3"}"
status: "Unprocessable Entity"

Edit My workaround for now is to add a 1000ms delay between each POST, then manually go back and check that everything is as it should be.


#5

Hi all,

Are you still experiencing this issue?