JIRA CLOUD API - OAuth (1.0a) && Basic HTTP - POST Method

I've been trying to create a form using JIRA CLOUD APIs to POST data and create Issues using React App, I have came to the conclusion that the only way to accomplish this using OAuth (1.0a) and/or Basic HTTP is to create a custom ExpressJs middleware. 

With both authentication methods I'm able to GET data from JIRA, however I've been really struggling to find the right solution to POST data to JIRA.

I tried Atlassian-Connect as well. 

Here is what I have so far for POST


app.get('/issue', function(req, res) {

  var html = '<form action="/issue" method="post">' +
               'summary:' +
               '<input type="text" name="summary" placeholder="summary" />' +
               '<br>' +
               'description:' +
               '<input type="text" name="description" placeholder="description" />' +
               '<br>' +
               '<button type="submit">Submit</button>' +


app.post('/issue', function(req, res){
  var consumer = new OAuth(
      fs.readFileSync('./jira.pem', 'utf8'), //consumer secret, eg. fs.readFileSync('jira.pem', 'utf8')

  var summary = req.body.summary;
  var description = req.body.description;

  // var html = 'summary: ' + summary + '.<br>' + 'description: ' + description + '.<br>' +
  //            '<a href="/issue">Got it.</a>';
  // res.send(html);

  params = {
    "fields": {
          "key": "BG"
       "summary": summary,
       "description": description,
       "issuetype": {
          "name": "Bug"

  function callback(error, data, resp) {
      data = JSON.parse(data);
      console.log("data,", data, "error,", error);
      return res.send(data);

      "access_token", //authtoken
      "secret", //oauth secret

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

1,011 views 3 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you