Jira.js and node.js cant create issue

Viewed 23

Im trying to create issue with the plugin Jira.js and with this code I can't realize what is wrong. I tested before to get all the projects with the same client and it worked fine

import { Version3Client } from 'jira.js';


const client = new Version3Client({
    host: 'https://myproject.atlassian.net/',
    newErrorHandling: true,
    authentication: {
      basic: {
        email: 'email@gmail.com',
        apiToken: 'tokenkey',
      },
    },
});

async function main() {
    const projects = await client.issues.createIssue({
        fields: {
            project:
            {
                id: '10005',
               key: "PRB"
            },
            summary: "REST ye merry gentlemen.",
            description: "Creating of an issue",
            issuetype: {
                id: '22222',
                name: "Bug"
            },
        }
    })
    console.log(projects)
}

main().catch(e =>  {
    console.log(e.message);
});
0 Answers
Related