const Request = require('request');

module.exports = (options, cb) => {
  const payload = { 'assignees': [ options.userName ] };

  Request.post({
    url: options.assignUrl,
    headers: {
      'User-Agent': 'GitPom',
      'Authorization': `token ${options.access_token}`
    },
    json: payload
  }, cb);
};

const Request = require('request');

module.exports = (options, cb) => {
  const headers = {
    'User-Agent': 'GitPom',
    'Authorization': `token ${options.access_token}`
  };
  const assignUrl = options.issueUrl + '/asignees';
  const labelUrl = options.issueUrl + '/labels';
  const assignPayload = { 'assignees': [ options.userName ] };
  const labelPayload = [ 'In Progress' ];

  Request.post({
    url: assignUrl,
    headers: headers,
    json: assignPayload
  }, (err, res, body) => {
    if (err) cb(err);
    else {
      Request.post({
        url: labelUrl,
        headers: headers,
        json: labelPayload
      }, cb);
    }
  });
};

Add additional POST request to create 'In Progress' label on issue
Add additional POST request to create 'In Progress' label on issue
