[Duplicate] Creating Issue with Jira Api using NodeJS

shakir ullah May 12, 2017

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 for this post are closed

Community moderators have prevented the ability to post new comments.

Post a new discussion

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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. 

TAGS
AUG Leaders

Atlassian Community Events