Get Issue

Script gitlab Verified

by rossrekrutkin ยท 6/6/2022

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 164 days ago
1
//native
2
export async function main(
3
  glab: RT.Gitlab,
4
  projectId: number,
5
  issueId: number
6
) {
7
  const url = `${glab.baseUrl}/api/v4/projects/${projectId}/issues/${issueId}`;
8
  const issue = await fetch(`${url}`, {
9
    headers: { Authorization: `Bearer ${glab.token}` },
10
  });
11
  return await issue.json();
12
}
13

Other submissions
  • Submitted by lplit Deno
    Created 386 days ago
    1
    /*
    2
    @param: {Gitlab} glab - Resource containing Gitlab Auth API Key
    3
    Example:
    4
    {
    5
      auth: gitlab_api_key,
    6
      baseUrl: "https://www.gitlab.com"
    7
    }
    8
    */
    9
    type Gitlab = {
    10
      baseUrl: string;
    11
      token: string;
    12
    };
    13
    export async function main(glab: Gitlab, projectId: number, issueId: number) {
    14
      const url = `${glab.baseUrl}/api/v4/projects/${projectId}/issues/${issueId}`;
    15
      const issue = await fetch(`${url}`, {
    16
        headers: { Authorization: `Bearer: ${glab.token}` },
    17
      });
    18
      return await issue.json();
    19
    }
    20
    
    
  • Submitted by steven orvis919 Bash
    Created 1039 days ago
    1
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    2
    /*
    3
    @param: {wmill.Resource<"gitlab">} glab - Resource containing Gitlab Auth API Key
    4
    Example:
    5
    {
    6
      auth: gitlab_api_key,
    7
      baseUrl: "https://www.gitlab.com"
    8
    }
    9
    */
    10
    export async function main(
    11
      glab: wmill.Resource<"gitlab">,
    12
      projectId: number,
    13
      issueId: number
    14
    ) {
    15
      const url = `${glab.baseUrl}/api/v4/projects/${projectId}/issues/${issueId}`;
    16
      const issue = await fetch(`${url}`, {
    17
        headers: { "PRIVATE-TOKEN": `${glab.token}` },
    18
      });
    19
      return await issue.json();
    20
    }
    21