Feature Request: Allow to add projects to the issue template

Thank you for considering.

2 Likes

Yes, this would really be great!  We would really like issues to be automatically added to our Project ‘To Do’ list as they are added to an issue tracker as the current extra step of assigning the issue to a Project is easily missed. 

Also, please support specifying an organization-level project as well as a repo-level project. 

Thanks!

7 Likes

Thanks for your plus one @holysamosa, I’ve taken your suggestion and passed it along to the appropriate teams. Thanks again for reaching out :grinning:

This was previously available - projects was an option available within custom MD files. It looks like it still works for urls in the format:
https://github.com/octo-org/octo-repo/issues/new?title=Bug+fix&projects=octo-org/1

This is documented in multiple places. The problem is the links from the issue-chooser do not include the projects parameter.

So this is something that was available, but is no longer.  Hmmmm.

Can I just add, it would be awesome to get something more than a thanks-but-we’ll-ignore-it answer? This is clearly a bug or a QA issue at best.

4 Likes

Hey @jasonbuck,

I appreciate the extra info, let me do a little digging and see where we are here, as far as what changes happened and our plans to implement. As far as I know the only option we’ve always had was

to move all Issues automatically to a project board via API, if this sounds like an option?

If it does, listening for an Issue event on the repository will trigger any time an Issue is created:

https://developer.github.com/v3/activity/events/types/#issuesevent

This can be set up using a webhook, or you can also use GitHub Actions if it’s enabled for your Organisation:

https://developer.github.com/webhooks/creating/
https://developer.github.com/actions/

The following API can be used to add the Issue to a Project board after receiving the message above:
https://developer.github.com/v3/projects/cards/#create-a-project-card

I hope to post back with some news soon, thank you for patience, and again thank you for the additional details.

2 Likes

Thank you @jasonbuck for the info with the URLs - it makes a decent workaround possible: If you add a config.yml file to your .github/ISSUE_TEMPLATE/ directory, you can use contact_links to provide the direct URLs. Don’t forget to remove the YAML frontmatter from your TEMPLATE.md files, to keep the issue templates from showing up twice.

Here is an example of a config.yml:

blank_issues_enabled: false
contact_links:
  - name: Feature Request
    about: Request a new feature
    url: https://github.com/Narigo/some-project/issues/new?template=FEATURE_REQUEST.md&projects=Narigo%2Fsome-project%2F1&labels=%3Azap%3A%20new
  - name: Bug Report
    about: Create a report of the issue you've encountered.
    url: https://github.com/Narigo/some-project/issues/new?template=BUG_REPORT.md&projects=Narigo%2Fsome-project%2F1&labels=%3Aant%3A%20bug
  - name: Question
    about: Ask a question about usage or anything
    url: https://github.com/Narigo/some-project/issues/new?template=QUESTION.md&projects=Narigo%2Fsome-project%2F2&labels=%3Aquestion%3A%20question%2C%3Ashrug%3A%20support

The official documentation about config.yml does not yield much more information - if I could change the button not to look like it’s linking to something external, that would be great :wink:

6 Likes

Would love to have this too!

2 Likes

So I am not alone :sweat_smile:

1 Like

Actually I just tried to add Project and Milestone to my template and found this thread…
Will I need to create a new thread to discuss adding a Milestone?

2 Likes

I would love this feature as well! It would be very helpful to have particular types of issues such as bugs or tracking issues be automatically added to a project.

@Narigo @jasonbuck thanks your suggestions helped me add projects and milestone to the issue template, but the button don’t just look it, it actually opens in a new tab.

https://github.com/username/repo-name/issues/new?assignees=&labels=enhancement&template=FEATURE_REQUEST.md&title=[FEATURE+REQUEST]+&projects=username%2Frepo-name%2F1&milestone=milestone_name

Is there a way to force the issue page to open in current tab…?

1 Like

I haven’t found a way to open it in the same tab, sorry. I live with it for now. If you find a way, please share :slight_smile: Or vote for this feature to get implemented by GitHub :smiley:

1 Like

@andreagriffiths11 This should definitely be included in the issue template, along with the existing “assignees” and “labels” parameters. Is there any way to escalate this request?

5 Likes

Current workaround is to use Github Actions such as https://github.com/marketplace/actions/assign-to-one-project

3 Likes

Would also love for GitHub to add support for ‘Projects’ and ‘Milestone’ being included in Issue Templates.
As others have mentioned, I have also found the YAML resources provided by Github to be lacking; a straightforward list of commands/labels would be appreciated.

1 Like

This is currently the only thing stopping me from using Github to manage our projects. I don’t want to set up actions to do such a simple task, I’d like to have a simple issues template that I can share with many projects within the enterprise.

I’d also like to add that the flow I would like here is:

  • We have one organization with many repositories
  • We would like to track issues in multiple repositories
  • We would like to triage and prioritize issues from all repositories within the organization on one project board
  • We don’t expect engineers who log bugs to select the project for an issue, as this information is only relevant for my team, who is tracking and prioritizing issues.

If I understand correctly, even with actions, I would need to add this action to all repositories in which bugs are logged? I would much rather add a bug report template to each new repo created within the org (simple .md file)

I found this thread looking for the exact same feature. Thank you for considering this.

4 Likes

Here is the final config.yml I used.

blank_issues_enabled: false
contact_links:
  - name: Video Ticket
    about: Use this template to create a ticket for each video
    url: https://github.com/djpeach/MilitaryMike/issues/new?template=video.md&assignees=djpeach&labels=Video&title=Video+%230+-+ContentTitle&milestone=Series+Done&projects=djpeach%2FMilitaryMike%2F1

Here is the final template.md I used:

In this video we will...

The url in the config.yml handles the assignee, the title, the template, the project, the milestone, and the labels. Important to note the projects syntax is &projects=<username>%2F<repo>%2F<project board number>, which is slightly different than the docs

The template at this point is just handling the default text in the content portion of the issue

Hi All,

Consider using GitHub Actions to automatically add an issue to your project. Sample workflow below :slight_smile:

name: Auto Assign Issues to Projects

on:
  issues:
    types: [labeled]
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  assign_to_project:
    runs-on: ubuntu-latest
    name: Assign topic to Project
    steps:
    - name: Assign issues with new-topic label to GitHub Project
      uses: srggrs/assign-one-project-github-action@1.2.0
      if: contains(github.event.issue.labels.*.name, 'new-topic')
      with:
        project: 'https://github.com/<project location>'
        column_name: 'No Status'
1 Like

“Show issues in project board” is one of the most basic requirements for all PM tools.

Suggesting every user should hack this together themselves by configuring GitHub Actions in every repo is not helpful. The OP has very reasonably suggested adding this field to the issue template, which can then be configured globally across an org or locally per template. Not only is this intuitive, it cannot be that much work to extend the existing feature.

Is this at least fixed in the new project features?