create_card: Create a card in a GitHub project

Description Usage Arguments Details Value Examples

View source: R/cards.R

Description

This function creates a new card in the specified column in a project in GitHub. The card can either contain an existing issue or pull request or you can create a note.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
create_card(
  content_id,
  content_type,
  note,
  column,
  project,
  repo,
  user,
  org,
  ...
)

Arguments

content_id

(integer, optional) The issue or pull request id associated with this card. Note: content_type is also required.

content_type

(string, optional) Whether the content_id identifies an "Issue" or a "PullRequest".

note

(string, optional) The card's note content. Not used if content_id is specified.

column

(integer or string) Either the ID or name of the column.

project

(integer or string) Either the project number or name.

repo

(string, optional) The repository specified in the format: owner/repo.

user

(string, optional) The login of the user.

org

(string, optional) The name of the organization.

...

Parameters passed to gh_request().

Details

You can create a card in a project associated with either a repository, user or organization, by supplying them as an input, as long as you have appropriate permissions.

For more details see the GitHub API documentation:

Value

create_card() returns a list of the card properties.

Card Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 

  # Create an issue card in a repository project
  create_card(
    content_id   = 1,
    content_type = "Issue",
    column       = "Test column",
    project      = "Test project",
    repo         = "ChadGoymer/githapi"
  )

  # Create a pull request card in a user's project
  create_card(
    content_id   = 2,
    content_type = "PullRequest",
    column       = "Test column",
    project      = "Test project",
    user         = "ChadGoymer"
  )

  # Create a note card in an organization's project
  create_card(
    note    = "This is a note",
    column  = "Test column",
    project = "Test project",
    org     = "HairyCoos"
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.