Skip to content

Commit 92221f9

Browse files
guntripgithub-actionssaritai
authored
[2023-01-20] Auto-add workflow for Projects (#33834)
Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
1 parent 2fffeef commit 92221f9

File tree

14 files changed

+127
-8
lines changed

14 files changed

+127
-8
lines changed
13.2 KB
Loading
13.6 KB
Loading

Diff for: assets/images/help/projects-v2/workflow-autoadd.png

12 KB
Loading
8.09 KB
Loading
6.07 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Adding items automatically
3+
intro: "You can configure your project to automatically add items from a repository that match a filter."
4+
miniTocMaxHeadingLevel: 3
5+
versions:
6+
feature: projects-v2-auto-add
7+
type: tutorial
8+
product: "The auto-add workflow is available as a beta release for projects owned by organizations using {% data variables.product.prodname_ghe_cloud %}."
9+
topics:
10+
- Projects
11+
---
12+
13+
## About automatically adding items
14+
15+
You can configure your project's built-in workflows to automatically add new items as they are created or updated in a repository. You can define a filter to only add items that meet your criteria.
16+
17+
When you enable the auto-add workflow, existing items matching your criteria will not be added. The workflow will add items when created or updated if the item matches your filter. For more information on manually adding items, see "[Bulk adding issues and pull requests](/issues/planning-and-tracking-with-projects/managing-items-in-your-project/adding-items-to-your-project#bulk-adding-issues-and-pull-requests)."
18+
19+
The auto-add workflow supports a subset of filters. You can use the following filters when configuring your workflow.
20+
21+
| Qualifier | Possible values
22+
| --- | --- | --- |
23+
| `is` | open, closed, merged, draft, issue, pr
24+
| `label` | "label name"
25+
| `reason` | completed, reopened, "not planned"
26+
| `assignee` | {% data variables.product.product_name %} username
27+
| `no` | label, assignee, reason
28+
29+
All filters, other than `no`, support negation. For example, you could use `-label:bug` to add issues that do not have the "bug" label.
30+
31+
## Configuring the auto-add workflow in your project
32+
33+
{% data reusables.projects.access-workflows %}
34+
1. In the "Default workflows" list, click **Auto-add to project**.
35+
36+
![Screenshot showing auto-add workflow](/assets/images/help/projects-v2/workflow-autoadd.png)
37+
38+
1. To start editing the workflow, in the top right, click **Edit**.
39+
40+
![Screenshot showing edit button](/assets/images/help/projects-v2/workflow-start-editing.png)
41+
42+
1. Under "Filters", select the repository you want to add items from.
43+
44+
![Screenshot showing repository select](/assets/images/help/projects-v2/workflow-autoadd-repo.png)
45+
46+
1. Next to the repository selection, type the filter criteria you want items to match before they are automatically added to your project.
47+
48+
![Screenshot showing repository select](/assets/images/help/projects-v2/workflow-autoadd-filter.png)
49+
50+
1. To enable the new workflow, click **Save and turn on workflow**.
51+
52+
![Screenshot showing autoadd workflows](/assets/images/help/projects-v2/workflow-save-and-turn-on.png)
53+
54+
55+
## Further reading
56+
57+
* "[Archiving items from your project](/issues/planning-and-tracking-with-projects/managing-items-in-your-project/archiving-items-from-your-project)"
58+
* "[Using the built-in automations](/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations)"

Diff for: content/issues/planning-and-tracking-with-projects/automating-your-project/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ children:
1111
- /using-the-built-in-automations
1212
- /using-the-api-to-manage-projects
1313
- /automating-projects-using-actions
14+
- /adding-items-automatically
1415
- /archiving-items-automatically
1516
allowTitleToDifferFromFilename: true
1617
---
17-

Diff for: content/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ topics:
1616

1717
{% endnote %}
1818

19-
{% data reusables.projects.about-workflows %}
19+
{% data variables.product.prodname_projects_v2 %} includes built-in workflows that you can use to update the **Status** of items based on certain events. For example, you can automatically set the status to **Todo** when an item is added to your project or set the status to **Done** when an issue is closed.
20+
21+
When your project initializes, two workflows are enabled by default: When issues or pull requests in your project are closed, their status is set to **Done**, and when pull requests in your project are merged, their status is set to **Done**.
22+
23+
{% ifversion projects-v2-auto-archive %}You can also configure {% ifversion projects-v2-auto-add %}workflows{% else %}a workflow{% endif %} to automatically archive items when they meet set criteria{% ifversion projects-v2-auto-add %} and to automatically add items from a repository when they match a filter{% endif %}. For more information, see "[Archiving items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/archiving-items-automatically){% ifversion projects-v2-auto-add %}" and "[Adding items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/adding-items-automatically){% endif %}."{% endif %}
2024

2125
You can enable or disable the built-in workflows for your project.
2226

Diff for: content/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects.md

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ You can use custom fields to add metadata to your issues, pull requests, and dra
3030
- A text field to add a quick note.
3131
- An iteration field to plan work week-by-week, including support for breaks.
3232

33+
### Automating your projects
34+
35+
There are a number of ways you can add automation to your project. Built-in workflows allow you to automatically set fields when items are added or changed{% ifversion projects-v2-auto-archive %}, and you can also configure your project to automatically archive items when they meet certain criteria{% ifversion projects-v2-auto-add %} and automatically add items from a repository when they match set criteria{% endif %}{% endif %}. For more information, see "[Using the built-in automations](/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations)."
36+
37+
You can also use the GraphQL API and {% data variables.product.prodname_actions %} to take even greater control of your project. For more information, see "[Using the API to manage Projects](/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects)" and "[Automating Projects using Actions](/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions)."
38+
3339
{% ifversion projects-v2-tasklists %}
3440

3541
### Exploring the relationships between issues

Diff for: content/issues/planning-and-tracking-with-projects/learning-about-projects/best-practices-for-projects.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ To prevent information from getting out of sync, maintain a single source of tru
6262

6363
You can automate tasks to spend less time on busy work and more time on the project itself. The less you need to remember to do manually, the more likely your project will stay up to date.
6464

65-
{% data variables.product.prodname_projects_v2 %} offers built-in workflows. For example, when an issue is closed, you can automatically set the status to "Done." {% ifversion projects-v2-auto-archive %}You can also configure built-in workflows to automatically archive items when they meet certain criteria.{% endif %}
65+
{% data variables.product.prodname_projects_v2 %} offers built-in workflows. For example, when an issue is closed, you can automatically set the status to "Done." {% ifversion projects-v2-auto-archive %}You can also configure built-in workflows to automatically archive items when they meet certain criteria{% ifversion projects-v2-auto-add %} and to automatically add items from a repository when they match a filter{% endif %}.{% endif %}
6666

6767
Additionally, {% data variables.product.prodname_actions %} and the GraphQL API enable you to automate routine project management tasks. For example, to keep track of pull requests awaiting review, you can create a workflow that adds a pull request to a project and sets the status to "needs review"; this process can be automatically triggered when a pull request is marked as "ready for review."
6868

6969
- For more information about the built-in workflows, see "[Using the built-in automations](/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations)."{% ifversion projects-v2-auto-archive %}
70-
- For more information about automatically archiving items, see "[Archiving items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/archiving-items-automatically)."{% endif %}
70+
- For more information about automatically archiving items, see "[Archiving items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/archiving-items-automatically)."{% endif %}{% ifversion projects-v2-auto-add %}
71+
- For more information about automatically archiving items, see "[Adding items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/adding-items-automatically)."{% endif %}
7172
- For an example workflow, see "[Automating {% data variables.product.prodname_projects_v2 %} using Actions](/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions)."
7273
- For more information about the API, see "[Using the API to manage {% data variables.product.prodname_projects_v2 %}](/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects)."
7374
- For more information about {% data variables.product.prodname_actions %}, see ["{% data variables.product.prodname_actions %}](/actions)."

Diff for: content/issues/planning-and-tracking-with-projects/learning-about-projects/quickstart-for-projects.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ topics:
1414

1515
## Introduction
1616

17-
This guide demonstrates how to use {% data variables.product.prodname_projects_v2 %} to plan and track work. In this guide, you will create a new project and add a custom field to track priorities for your tasks. You'll also learn how to create saved views that help you communicate priorities and progress with your collaborators.
17+
This guide demonstrates how to use {% data variables.product.prodname_projects_v2 %} to plan and track work. In this guide, you will create a new project and add a custom field to track priorities for your tasks. You'll learn how to create saved views that help you communicate priorities and progress with your collaborators. You'll also set up built-in workflows to manage the items in your project.
1818

1919
## Prerequisites
2020

@@ -146,6 +146,33 @@ To indicate the purpose of the view, give it a descriptive name.
146146

147147
## Configure built-in automation
148148

149+
{% ifversion projects-v2-auto-add %}
150+
151+
Next, configure the auto-add workflow to automatically add issues opened in a repository with a specific label to your project.
152+
153+
{% data reusables.projects.access-workflows %}
154+
1. In the "Default workflows" list, click **Auto-add to project**.
155+
156+
![Screenshot showing auto-add workflow](/assets/images/help/projects-v2/workflow-autoadd.png)
157+
158+
1. To start editing the workflow, in the top right, click **Edit**.
159+
160+
![Screenshot showing edit button](/assets/images/help/projects-v2/workflow-start-editing.png)
161+
162+
1. Under "Filters", select the repository you want to add items from.
163+
164+
![Screenshot showing repository select](/assets/images/help/projects-v2/workflow-autoadd-repo.png)
165+
166+
1. Next to the repository selection, type the filter criteria you want items to match before they are automatically added to your project. For example, to catch all issues and PRs opened with the label "bug", use `is:issue,pr label:bug`.
167+
168+
![Screenshot showing repository select](/assets/images/help/projects-v2/workflow-autoadd-filter.png)
169+
170+
1. To enable the new workflow, click **Save and turn on workflow**.
171+
172+
![Screenshot showing autoadd workflows](/assets/images/help/projects-v2/workflow-save-and-turn-on.png)
173+
174+
{% endif %}
175+
149176
Finally, add a built in workflow to set the status to **Todo** when an item is added to your project.
150177

151178
1. In the top-right, click {% octicon "kebab-horizontal" aria-label="The menu icon" %} to open the menu.

Diff for: content/issues/planning-and-tracking-with-projects/managing-items-in-your-project/adding-items-to-your-project.md

+22
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Your project can track draft issues, issues, and pull requests.
2121

2222
### Adding issues and pull requests to a project
2323

24+
You can add issues and pull requests to your project individually{% ifversion projects-v2-auto-add %}, automatically, {% endif %} or in bulk. You can also add draft issues which can later be transformed into issues. For more information, see "[Creating draft issues](#creating-draft-issues)."
25+
2426
{% ifversion projects-v2-timeline-events %}
2527

2628
{% note %}
@@ -33,12 +35,24 @@ When you add an issue or pull request to your project, an event will be added to
3335

3436
{% endif %}
3537

38+
{% ifversion projects-v2-auto-add %}
39+
40+
#### Automatically adding issues and pull requests
41+
42+
You can configure a built-in workflow to automatically add issues and pull requests from a repository when they meet specific filter criteria. For more information about configuring a workflow, see "[Adding items automatically](/issues/planning-and-tracking-with-projects/automating-your-project/adding-items-automatically)."
43+
44+
{% endif %}
45+
3646
#### Pasting the URL of an issue or pull request
3747

48+
You can copy the URL of an issue or pull request into your clipboard and paste that into your project.
49+
3850
{% data reusables.projects.add-item-via-paste %}
3951

4052
#### Searching for an issue or pull request
4153

54+
If you know the issue or pull request number or if you know part of the title, you can search for an issue or pull request directly from your project.
55+
4256
{% data reusables.projects.add-item-bottom-row %}
4357
2. Enter <kbd>#</kbd>.
4458
3. Select the repository where the pull request or issue is located. You can type part of the repository name to narrow down your options.
@@ -48,6 +62,8 @@ When you add an issue or pull request to your project, an event will be added to
4862

4963
#### Bulk adding issues and pull requests
5064

65+
You can add multiple issues and pull requests from your project and use filters, such as `label:bug`, to narrow down your search.
66+
5167
1. In the bottom row of the project, click {% octicon "plus" aria-label="plus icon" %}.
5268
![Screenshot showing + button at the bottom of the project](/assets/images/help/projects-v2/omnibar-add.png)
5369
1. Click **Add item from repository**.
@@ -56,6 +72,8 @@ When you add an issue or pull request to your project, an event will be added to
5672

5773
#### Adding multiple issues or pull requests from a repository
5874

75+
You can also add issues and pull requests to your project from a repository's issue and pull request lists.
76+
5977
1. On {% data variables.location.product_location %}, navigate to the repository that contains the issues or pull requests you want to add to your project.
6078
{% data reusables.repositories.sidebar-issue-pr %}
6179
1. To the left of each issue title, select the issues that you want to add to your project.
@@ -69,6 +87,8 @@ When you add an issue or pull request to your project, an event will be added to
6987

7088
#### Assigning a project from within an issue or pull request
7189

90+
You can also add an issue or pull request to your project from within the issue or pull request itself.
91+
7292
1. Navigate to the issue or pull request that you want to add to a project.
7393
2. In the side bar, click **Projects**.
7494
![Screenshot showing "Projects" in the issue sidebar](/assets/images/help/projects-v2/issue-sidebar-projects.png)
@@ -79,6 +99,8 @@ When you add an issue or pull request to your project, an event will be added to
7999

80100
#### Using the command palette to add an issue or pull request
81101

102+
You can use the command palette when viewing your project to quickly add items.
103+
82104
1. {% data reusables.projects.open-command-palette %}
83105
1. Start typing "Add items" and press <kbd>Return</kbd>.
84106
{% data reusables.projects.bulk-add %}

Diff for: data/features/projects-v2-auto-add.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Issue 8996
2+
# ProjectV2 auto-adding
3+
versions:
4+
ghec: '*'

Diff for: data/reusables/projects/about-workflows.md

-3
This file was deleted.

0 commit comments

Comments
 (0)