[Duplicate] Creating Issue with Jira Api using NodeJS Edited

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);
}
)

 

1 comment

Comments Closed
Thomas Schlegel Community Champion May 12, 2017

The question was asked twice. Here's the second one: https://community.atlassian.com/t5/Questions/Creating-Issue-with-Jira-Api-using-NodeJS/qaq-p/586511

Please post your answers there. 

Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published 3 hours ago in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

24 views 0 2
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