Creates gitlab issues with the given payload
The gitlab API requires the project ID to be given as payload to create an issue. This module finds the project ID from the project and namespace.
npm install --save gitlab-create-issue
{
namespace: 'argonlaser',
project: 'gitlab-create-issue-test',
privateToken: 'xxxxxxx',
title: 'TITLE'
}
{
description: 'create issue',
assigneeName: 'argonlaser' (or) assigneeId: '111111',
labels: ['AAA', 'BBB'],
dueDate: 'YYYY-MM-DD'
}
var createIssue = require('gitlab-create-issue')
var mandatoryPayload =
{
namespace: 'argonlaser',
project: 'gitlab-create-issue-test',
privateToken: process.env.privateToken,
title: 'Title'
}
var optionalPayload =
{
assigneeName: 'argonlaser',
dueDate: '2018-11-11'
}
createIssue(mandatoryPayload, optionalPayload, function (err, res) {
if (err) {
// Handle error
} else {
// Do something with response
}
}