Creating Issue with Jira Api using NodeJS

Hello Everyone,

I am facing problem when i try to create an jira issue in nodeJs Api. it give me Following Error.
I am using Oauth for Authentication.


oauth_problem=signature_invalid&oauth_signature=e7f1begkIuYdrDrVgfCSMeIMGu4U6L5EFivxKUh7XpgwkXiGrsGO1VyX0DiW5R%2B61WaRv4H3vwdUGjf0Y3ABghjepTD3gSjVfOoqh9s7Gio5Tj2MxSMnnx%2FDWR0U3tKTRov2UAV1tmc96C03%2BBdlvu8YUVQU0PP7FHkS5mfqfJnR2W4S2WkFVHUVaq856eGVY%2B5Rdba5SY0df6R%2BchIbcvigut48mt5pkovf3u9MR88xH6wI%2BkFilr7PVMpF4wzbQHK4MJnOfZD2E%2BN83RMGW0fMrYRJCXtCGCmi9ZX%2FOId%2Bcw%2FUlgvIhg1Ba8oWpEkm9ee6kp3Ni2n1hMTuU%2FK3LQ%3D%3D&oauth_signature_base_string=POST%26https%253A%252F%252Fblameless.atlassian.net%252Frest%252Fapi%252F2%252Fissue%26fields%253D%2526oauth_consumer_key%253Dabcde%2526oauth_nonce%253DZxYnMUftfrkptrz7PA69MpkA5nR6exPH%2526oauth_signature_method%253DRSA-SHA1%2526oauth_timestamp%253D1494572935%2526oauth_token%253DMS7v1GgzIx93yOa2HQJRMsMHXAVDzV2u%2526oauth_version%253D1.0&oauth_signature_method=RSA-SHA1

I am follwing the NodeJs example code(https://bitbucket.org/atlassian_tutorial/atlassian-oauth-examples) jira mention in Api Doc.

GET request is doing fine but There is problem with POST requests.

I Create an Application Link for Oauth with Application Url = http://blameless-api.herokuapp.com. This is where my Api is hosted.

My Issue Creation Code:
var consumer =
new OAuth(req.body.baseUrl + "/plugins/servlet/oauth/request-token",
req.body.baseUrl + "/plugins/servlet/oauth/access-token",
req.body.consumerKey,
"",
"1.0",
req.body.callback,
"RSA-SHA1",
null,
req.body.privateKey);
consumer.post(req.body.baseUrl + "/rest/api/2/issue",
req.body.token,
req.body.tokenSecret,
data,
"application/json",
function(error, data, resp) {
console.log(data);
// data = JSON.parse(data);
res.send(data);
}
)

2 answers

This widget could not be displayed.

Hi 

I have a link to create issue using node js. you can follow the link hope it will helpful for you.

https://developer.atlassian.com/articles/create-an-issue/

 

Thanks 

Anil Singh

Programmer Analyst

http://www.mirketa.com/

This widget could not be displayed.

Here is a project I plan on using... haven't tested it yet though https://github.com/nicolasbettag/create-jira-ticket-api

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

171 views 18 7
Join discussion

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